AnalyzeModificationsA

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 AnalyzeModifications and string arguments are interpreted using the current SetAnsiMode code page

Classifies every change since a saved revision against the modification whitelist used by signature validation

Syntax

Delphi

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

DLL

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

Return values

0No document is selected, the file does not exist or could not be loaded
NNumber of classified findings; read the overall level with GetModificationLevel

Remarks

Loads OldFileName as the pre-change side, runs the structural comparison of CompareWith, then classifies each added or changed object from its post-change form: DSS and VRI dictionaries, cross-reference streams, catalog metadata and appended signature dictionaries count as LTA updates; dictionaries carrying a field type with a set value count as form filling; annotation dictionaries by type or ISO 32000-2 Table 168 subtype count as annotations. A dictionary is accepted as a DSS or a signature dictionary only when every key it carries belongs to that kind of dictionary, and a changed object keeps its class only when the object it replaced was of the same kind, so a page, font or resource dictionary rewritten with such keys or types stays unclassified. Everything else, including removed non-LTA objects and page-count differences, is unclassified. The overall level is the maximum across findings, ordered none, LTA updates, form filling, annotations, unclassified, so a DocMDP level check reduces to comparing GetModificationLevel against the policy

Example

if PDF.AnalyzeModifications("signed_v1.pdf", "")> 0 then
  Level:= PDF.GetModificationLevel;

See also

CompareWith