ExtractDocumentRevision

Page manipulation

Requires the Small Business edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibSmallBusiness (unit PDFlibSmallBusiness) or TPDFlibEnterprise; the Small Business and Enterprise DLL and ActiveX builds provide it unchanged; the Single edition keeps the method, which returns 0 and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

Description

Writes an earlier revision of the document to a new file

Syntax

Delphi

Function ExtractDocumentRevision(RevisionIndex: Integer; Const OutputFileName: WideString): Integer; Virtual;

ActiveX

Function PDFlib::ExtractDocumentRevision(RevisionIndex As Long, OutputFileName As String) As Long

DLL

int DLExtractDocumentRevision(int InstanceID, int RevisionIndex, const wchar_t* OutputFileName);
int DLExtractDocumentRevisionA(int InstanceID, int RevisionIndex, const char* OutputFileName);

Parameters

RevisionIndex0-based revision (0 is the original file); use GetDocumentRevisionCount for the chain length
OutputFileNameTarget path for the extracted revision

Return values

1 on success, 0 when the document was not loaded from a file or the revision does not exist

Remarks

The output is the raw byte prefix of the source ending at the revision boundary, so signatures of that revision verify unchanged

See also

GetDocumentRevisionEnd, SaveChanges