THotPDF Utility Methods

This page lists public THotPDF helper methods that operate on existing PDF files or perform document-wide cleanup and analysis.

File Encryption and Decryption

Method Description
EncryptFile Encrypt an existing PDF directly from an input file to an output file. Overloads accept a EncryptFile, DecryptFile,
DecryptLoadedDocument - write encrypted output, decrypt an existing PDF, or decrypt a document already loaded by HotPDF. Decrypt an existing encrypted PDF to a new output file using the supplied password. The method returns SplitPDFToFiles, CopyDocumentMetadata - write selected logical pages to separate output files and copy document metadata from another HotPDF instance.
DecryptLoadedDocument Decrypt a document already loaded through LoadFromFile or LoadFromStream so it can later be saved as an unencrypted copy.

Optimisation and Repair

Method Description
SplitPDFToFiles Split selected logical pages from an input PDF into the corresponding output files. OptimizeOverlappingImages, FixImageClipping,
CopyDocumentMetadata Copy document information and related metadata from another THotPDF instance into the current document before output.

Optimisation and Repair Helpers

Method Description
OptimizeOverlappingImages Run a document-level cleanup pass for image-heavy content where overlapping image draws can be simplified before save.
FixImageClipping Repair image clipping state in page content where imported or edited content leaves clipping regions in a bad state for later output.
CalculateContentStreamScore, IsValidPageContentStream - simplify image-heavy content, repair image clipping state, and support diagnostics for page-content recovery. Inspect page content streams and classify whether they look usable for page-copy and repair workflows. These helpers are primarily useful for diagnostics and automated recovery paths.

See Also