AnalyzeModifications

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

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

Syntax

Delphi

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

ActiveX

Function PDFlib::AnalyzeModifications(OldFileName As String, OldPassword As String) As Long

DLL

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

Parameters

OldFileNamePath of the saved revision loaded as the pre-change side
OldPasswordPassword for OldFileName, or an empty string when it is not encrypted

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, catalogue 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