AnalyzeModifications

Diagnostics

Description

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

Syntax

Delphi

Function AnalyzeModifications(Const OldFileName, OldPassword: WideString): Integer;

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. 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