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
| 0 | No document is selected, the file does not exist or could not be loaded with the given password |
|---|---|
| N | Number 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 an indirect reference stands for the content of the object it points at rather than for its number, so renumbered-but-identical objects still match while a reference redirected to a different object does not. An object is therefore also reported as changed when an object it refers to changed. 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", "");