CreateSanitizationInventory

Security and sanitization

Description

Inspect a PDF file and return a JSON inventory of removable metadata, actions, scripts and hidden payloads without modifying the file

Syntax

Delphi

Function TPDFlib.CreateSanitizationInventory(Const FileName, Password: WideString): WideString;

Parameters

FileNamePath to the input PDF file to inspect
PasswordOpen password for encrypted files, or an empty string

Return values

Returns a JSON object with status (ok or error) and an inventory object listing counts and categories of removable content.

Remarks

Opens a private read-only document copy so the currently selected document in the library instance is not modified.

Pair the returned inventory with PublishSanitizedPDF or SanitizeDocument to strip selected categories.

See also

PublishSanitizedPDF, SanitizeDocument