|
THotPDF Advanced Workflow Methods
This page collects advanced public THotPDF methods that support loaded-document repair, file-backed rewriting, xref-stream parsing, conformance output, and shaping workflows
Prefer the task-focused pages such as page operation methods, loaded form field methods, utility methods, CMS validation reports, PDF/UA-2 structure, and ShapingFeatures for common application code
Loaded Document Resolution
| Method |
Usage |
DoPageOperationProgress | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
ResolveLoadedObject | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
ResolveLoadedDictionary | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
ResolveLoadedArray | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
EnsureLoadedRootIndex | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
MaterializeLazyStreams | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
FindLoadedFormFieldByIndex | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
FindLoadedFormFieldByName | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
ConfigurePDFVersion | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
RecoverReloadFEKFromBytes | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
LoadedEncryptVersion | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
IsObjStmMemberObject | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
SyncMaxObjNumFromLoadedObjects | Supports loaded-document resolution, form-field lookup, encryption metadata, or object-number bookkeeping in advanced workflows |
Direct File State and Rewrite
| Method |
Usage |
ClearDirectFileState | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
GetDirectFileIndex | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DAFindReplacementIndex | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DAReadObjectSource | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DAStoreObjectSource | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DAAppendObjectSourceInternal | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DATryBuildCompressedFileState | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DADirectLoadObjectFromBody | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DARecoverAES256FileKey | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DADirectPrepareObjectForAES256Encrypt | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DADirectDecryptObjectAES256 | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DAWriteDirectAES256Rewrite | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DADirectEncryptFileAES256 | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DADirectDecryptFileAES256 | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
DAWriteFullRewrite | Supports file-backed direct rewriting, AES-256 encryption or decryption, and object-source state handling |
XRef Stream and Object Parsing
| Method |
Usage |
LoadXRefStreamDocumentaesgcm | Uses the bounded-memory Direct File path to emit PDF 2.0 AESV4 streams with incremental CTR and GHASH processing |
DecryptFile | Authenticates every AESV4 stream before atomically replacing the requested output file |
AddStandalonePDFMAC | Adds a fixed 32-byte KDFSalt, a direct standalone AuthCode, exact full-file ByteRange coverage, CMS AuthenticatedData, and selectable SHA-2 or SHA-3 document digests |
SignPDFWithPFXAndAttachedPDFMAC | Creates one encrypted signed revision with a direct /AttachedToSig trailer binding, an indirect SigObjRef, and a PDF MAC unsigned attribute that authenticates the raw CMS signature value |
ValidatePDFMAC | Validates standalone or signature-attached locations and returns distinct status values for invalid passwords, malformed data, unsupported algorithms, policy rejection, coverage failures, document modification, signature binding failures, and authentication failures |
ValidatePDFMACChain | Validates every incremental revision from oldest to newest with cumulative xref indexing and reports the exact revision for a missing, replaced, salt-changed, digest-downgraded, or permission-downgraded PDF MAC |
Public-Key Encryption and Signature Evidence
| Method | Usage |
AddPubKeyRecipientCertificate | Builds an AES-256 CMS recipient envelope from an RSA certificate with explicit RSA-OAEP digest and MGF1 policies |
AddPubKeyAgreementRecipient | Builds P-256, P-384, P-521, X25519, or X448 key-agreement recipient envelopes using X9.63 KDF and AES-256 key wrap |
HPDFCMSBuildCounterSignerInfo | Creates a countersignature whose signed messageDigest binds the parent signature value without a contentType attribute |
HPDFVerifyCMSCounterSignatures | Extracts and verifies every CMS counterSignature value against its parent signature bytes |
RenewPAdESLTATimestamp | Appends a validated RFC 3161 document timestamp while preserving every earlier PDF revision byte-for-byte |
PDF/UA-2 Structure
| Method | Usage |
AddStructRoleMapNS | Adds a namespace-aware role mapping with a default PDF 1.7 or explicit target namespace |
SetStructureAttributeName | Adds or replaces a name-valued attribute in an owner-specific structure attribute dictionary |
SetStructureAttributeNumber | Adds or replaces an integer-valued structure attribute |
SetStructureTableCellHeaders | Writes explicit table header identifiers for a header or data cell |
AssociateFileWithStructure | Associates an indirect Filespec with a structure element |
AddAccessibleFormula | Creates a Formula structure element with alternative or actual text |
AddAccessibleMathMLFormula | Creates a Formula with an associated MathML file and MathML namespace child |
ValidatePDFUA2Structure | Runs bounded one-pass validation and returns typed issues or shared machine-readable findings with clause, object, and page locations |
RepairPDFUA2Structure | Atomically normalises recoverable PDF/UA-2 namespaces, structure attributes, semantic containers, accessibility text, language inheritance, heading order, and Artifact tags and can report per-finding repair provenance |
ComplianceFindingsToJSON | Serialises shared PDF/UA-2, PDF/A-4, and PDF/X-6 findings as deterministic versioned JSON |
Stable Native C ABI
| Export | Usage |
hpdf_document_create | Creates a validated opaque document handle through a flat cdecl boundary |
hpdf_document_load_from_io | Loads from versioned 64-bit random-access callbacks without a complete-source staging buffer |
hpdf_document_save_to_io | Streams serialised bytes to a callback and retries partial writes until each chunk is complete |
hpdf_document_page_count | Returns the loaded page count through a fixed-width output pointer |
hpdf_document_destroy | Releases a registered handle and rejects repeated destruction |
Deterministic Differential Regression
| Function | Usage |
HPDFProbeHotPDFDocument | Produces bounded SHA-256 parse, render, text, or save fingerprints with domain-specific normalisation |
HPDFCompareRegressionResultsDeterministic | Repeats two named engine probes, rejects instability and isolated exceptions, and compares selected domains in fixed order |
HPDFDifferentialRegressionInfoToJSON | Serialises signatures, instability, errors, counts, engine names, and the input digest as hotpdf.differential.v1 |
Continuous Malformed-PDF Corpus
| Function | Usage |
HPDFDefaultCorpusStoreOptions | Returns bounded minimisation, input, storage, and lock-retry defaults |
HPDFMinimizeAndStoreCorpusCase | Revalidates and re-minimises matching cases under one process-safe lock, then atomically retains the smallest signature-equivalent PDF |
HPDFCorpusCaseInfoToJSON | Serialises the stable case ID, failure signature, content digest, and byte count as hotpdf.corpus.case.v1 |
PDF/X-6 Exchange
| Method | Usage |
AddPDFX6PageOutputIntent | Attaches an embedded ICC output intent to one PDF 2.0 page |
AddPDFX6ExternalOutputIntent | Adds an external PDF/X-6p or N-colourant PDF/X-6n output profile reference at catalogue or page scope |
ValidatePDFX6 | Runs bounded non-mutating PDF/X-6 validation with typed or shared clause-aware object and page diagnostics |
XRef Stream and Object Parsing
| Method |
Usage |
LoadXRefStreamDocumentFromFile | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
LoadXRefStreamDocumentEncFromFile | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeObjCount | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeObjNum | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeCompactCount | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeType2Mismatches | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeObjHasKey | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeObjNameVal | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeCompactObjNum | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeType2EncryptedSkipped | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeCountReplacementChars | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeObjStringVal | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
XRefProbeDecryptObjStmSkips | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
TryParseModernPDF | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
CreateBasicPageContent | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
CreatePDF16PageReference | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
CreateBasicResources | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
CreatePDF16Resources | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ParseSimplePageObject | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ParseRealPageContent | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ProcessObjectStreamsForDecompression | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ScanAndLoadReferencedObjects | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ForceLoadMissingReferencedObjects | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
FindAllObjectStreams | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ExtractStreamParameters | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ProcessFlateDecode | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
AnalyzePageObject | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ExtendPageArr | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ParseSimpleDictionary | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ParseSimpleArray | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF filesTHPDFDictionaryObject |
ParseSimpleStream | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF filesTHPDFArrayObject |
ParseSimpleStream | Parses a stream body into a THPDFStreamObject |
FindAndProcessObjectStream | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ExtractObjectFromStream | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ExtractRawObjectFromStream | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
IsObjectInStream | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
GetObjectFromStream | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ParseModernPageObject | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
IntelligentDecompress | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
DecompressFlateDecode | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ParseObjectStream | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ReorderPageArrByPagesTree | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
GetCorrectPageOrderFromPagesTree | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
GetPageObjectId | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
GetPageArrIndexForObjectNumber | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ExtractNumericValue | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ParseDecompressedObjects | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
LoadCompressedXrefStream | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
LoadObjectStreamsDirectly | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ParseXrefStreamData | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
ProcessObjectStreamObjects | Supports xref-stream and object-stream parsing, recovery, and diagnostics for modern PDF files |
Conformance and Font Output
| Method |
Usage |
BuildAndApplyUnicodeFontSubset | Supports Unicode font-subset sharing and PDF/A, PDF/X, or PDF/UA conformance checks during output |
EnsurePDFUATabsOnAnnotatedPages | Supports Unicode font-subset sharing and PDF/A, PDF/X, or PDF/UA conformance checks during output |
EnsurePDFAOutputIntent | Supports Unicode font-subset sharing and PDF/A, PDF/X, or PDF/UA conformance checks during output |
EnsurePDFAColorSpaceConsistency | Supports Unicode font-subset sharing and PDF/A, PDF/X, or PDF/UA conformance checks during output |
EmitDocumentDefaultColorSpaces | Supports Unicode font-subset sharing and PDF/A, PDF/X, or PDF/UA conformance checks during output |
EnsurePDFXOutputIntent | Supports Unicode font-subset sharing and PDF/A, PDF/X, or PDF/UA conformance checks during output |
EnsurePDFXPageBoxes | Supports Unicode font-subset sharing and PDF/A, PDF/X, or PDF/UA conformance checks during output |
ValidatePDFX6GenerationProfile | Fails closed when the selected PDF/X-6 generation graph violates the profile |
_FindPAdESDSSStreamByDER | Finds an existing DSS stream whose DER bytes match a certificate, OCSP response, or CRL while building PAdES VRI references |
Advanced Shaping Helpers
| Method |
Usage |
ApplyArabicGSUBPositional | Applies Arabic positional GSUB substitutions and maps shaped glyph IDs through synthetic codepoints |
ArabicGSUBShapeToGIDs | Returns the Arabic GSUB-shaped glyph-ID sequence without emitting text |
ApplyArabicGSUBNativeShaping | Applies native Arabic GSUB shaping for fonts that provide positional glyph substitutions |
ApplyLatinLigatureFeature | Applies a named Latin ligature feature such as liga or clig to a Unicode run |
ApplyLatinSingleSubstitutionFeature | Applies a named Latin single-substitution feature to a Unicode run |
ApplyLatinFractionFeature | Applies the frac feature to a numeric fraction run when the font supplies the required substitutions |
ApplyArabicGSUBPositional | Supports advanced GSUB shaping, glyph mapping, and synthetic-codepoint workflows before text emission |
ArabicGSUBShapeToGIDs | Supports advanced GSUB shaping, glyph mapping, and synthetic-codepoint workflows before text emission |
ApplyArabicGSUBNativeShaping | Supports advanced GSUB shaping, glyph mapping, and synthetic-codepoint workflows before text emission |
ApplyLatinLigatureFeature | Supports advanced GSUB shaping, glyph mapping, and synthetic-codepoint workflows before text emission |
ApplyLatinSingleSubstitutionFeature | Supports advanced GSUB shaping, glyph mapping, and synthetic-codepoint workflows before text emission |
ApplyLatinFractionFeature | Supports advanced GSUB shaping, glyph mapping, and synthetic-codepoint workflows before text emission |
ApplyArabicGSUBRefinement | Supports advanced GSUB shaping, glyph mapping, and synthetic-codepoint workflows before text emission |
See also
|