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
| InputFileName | Path to the source PDF file |
|---|---|
| Password | Open password for encrypted input files, or an empty string |
| OutputFileName | Destination path for the sanitized PDF; must not already exist |
| Flags | Bitmask 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.