Revisions Property (PdfDocument)
Gets the document revisions.
PDF document revision is a state of PDF document at the moment when PDF document was signed using digital certificate.
Here is an example that shows how to save all revisions of PDF document to the separate files:
''' <summary>
''' Saves the revisions of PDF document to the separate files.
''' </summary>
''' <param name="filename">The filename of PDF document.</param>
Public Shared Sub SaveRevisions(filename As String)
' open PDF document
Using document As New Vintasoft.Imaging.Pdf.PdfDocument(filename)
Dim revisionFilename As String = String.Format("{0}\{1}_rev{{0}}.pdf", System.IO.Path.GetDirectoryName(filename), System.IO.Path.GetFileNameWithoutExtension(filename))
' if PDF document has revisions
If document.Revisions IsNot Nothing Then
' for each revision
For Each revision As Vintasoft.Imaging.Pdf.PdfDocumentRevision In document.Revisions
' save revision to a file
revision.CopyRevisionTo(String.Format(revisionFilename, revision.RevisionNumber))
Next
End If
End Using
End Sub
/// <summary>
/// Saves the revisions of PDF document to the separate files.
/// </summary>
/// <param name="filename">The filename of PDF document.</param>
public static void SaveRevisions(string filename)
{
// open PDF document
using (Vintasoft.Imaging.Pdf.PdfDocument document = new Vintasoft.Imaging.Pdf.PdfDocument(filename))
{
string revisionFilename = string.Format(@"{0}\{1}_rev{{0}}.pdf",
System.IO.Path.GetDirectoryName(filename),
System.IO.Path.GetFileNameWithoutExtension(filename));
// if PDF document has revisions
if (document.Revisions != null)
{
// for each revision
foreach (Vintasoft.Imaging.Pdf.PdfDocumentRevision revision in document.Revisions)
// save revision to a file
revision.CopyRevisionTo(string.Format(revisionFilename, revision.RevisionNumber));
}
}
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5