CompareWithA

Diagnostics

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, an empty string or False and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to CompareWith and string arguments are interpreted using the current SetAnsiMode code page

Structurally compares the selected document against a saved revision

Syntax

Delphi

Function DLCompareWithA(InstanceID: Integer; OldFileName: PAnsiChar; OldPassword: PAnsiChar): Integer;

DLL

int DLCompareWithA(int InstanceID, const char* OldFileName, const char* OldPassword);

Return values

0No document is selected, the file does not exist or could not be loaded with the given password
NNumber of findings; read them with the GetCompareFinding accessors

Remarks

Loads OldFileName as the old side and walks both documents, fingerprinting every indirect object from a canonical form in which indirect references collapse to markers so renumbered-but-identical objects still match. Pass one aligns objects by fingerprint; pass two pairs the remaining unmatched objects by number and reports them as changed, and anything still unpaired is added (new side) or removed (old side). Page-count differences are reported before object findings. The findings stay available until the next CompareWith call

Example

N:= PDF.CompareWith("invoice_v1.pdf", "");

See also

AuditObjectReachability, GetDocumentJSON