PublishSanitizedPDF

Security and sanitization

Description

Sanitize selected categories from an input PDF on a private candidate, verify removal on reopen, and publish exclusively with SHA-256

Syntax

Delphi

Function TPDFlib.PublishSanitizedPDF(Const InputFileName, Password, OutputFileName: WideString; Flags: Integer): WideString;

Parameters

InputFileNamePath to the source PDF file
PasswordOpen password for encrypted input files, or an empty string
OutputFileNameDestination path for the sanitized PDF; must not already exist
FlagsBitmask of supported SANITIZE_* category flags

Return values

Returns a JSON publication report containing before/after inventories, output byte count, and SHA-256 digest, or an error JSON object when validation or exclusive file creation fails.

Remarks

Performs full-save rewrite (never incremental update) on a private candidate, reopens the rewritten bytes to confirm that every requested category was cleared, and refuses to overwrite an existing destination file.

See also

CreateSanitizationInventory, SanitizeDocument