HotPDF 2.1221.11 for Delphi and C++Builder

Native PDF generation, editing, signing, standards-aware output, font optimisation, and imaging for RAD Studio applications

HotPDF lets VCL applications create, modify, secure, sign, optimise, import, compress, and save PDF documents directly from Delphi or C++Builder code, without deploying an external PDF runtime

New in This Release

Supported annotations that arrive without an appearance are kept by native page-import appearance recovery as vector content plus searchable text, covering rotated widgets and original CFF captions; the behaviour is opt-in through JSON and the C ABI in the same way

For text, buttons and choices, headless widget appearance recovery now honours quarter-turn rotation, including icon fitting under rotation and list-row viewports

After transparency composition, native headless tone-response transfer functions apply per-channel curves, with antialiasing that is aware of the transfer and bounded output reconstruction

Full version history lives in the release notes

Overview of the Project

HotPDF is a PDF component library delivered at source level for Delphi and C++Builder. Desktop software that wants deterministic PDF output, direct page drawing, close RAD Studio integration and a compact deployment footprint is exactly what it is built for

Everyday PDF generation, advanced document assembly, PDF editing, image-heavy output, forms, annotations, encryption, signing workflows, font optimisation and stream-based workflows are all served from one native API surface. The same engine also reaches services, Linux and Free Pascal through a native headless document API, a versioned C ABI and JSON document jobs, alongside the Windows THotPDF component

A Natural Fit for RAD Studio

Familiar Delphi and C++Builder projects, packages, streams, forms and drawing patterns are used directly rather than wrapping a separate PDF engine. Because integration is source-oriented, debugging and deployment stay under your control

Standards Awareness Throughout

Every public API is checked against the PDF version and conformance profile you selected, so a call that would break PDF/A, PDF/X or PDF/UA raises a diagnostic exception rather than quietly writing a non-compliant file

Compact Output, Fast

PDF size comes down through zlib-ng compression, libjpeg-turbo imaging, TrueType and OpenType-CFF subsetting, CID-keyed CFF support, and TrueType and CFF2 variable fonts that HotPDF instantiates internally

Modern PDF Features

Forms, annotations, layers, transparency, page transitions, tagged structure, encryption, signing placeholders and incremental updates are all available when you build a PDF

Bounded and Recoverable

Explicit byte, object, time and memory budgets govern parsing, decoding, rendering and conversion, backed by cooperative cancellation, typed diagnostics and atomic file publication whenever input is hostile or damaged

Reproducible Native Dependencies

Compression and imaging dependencies stay reproducible because the third-party C libraries are integrated statically, and behaviour in both language stacks is easier to verify thanks to the shared Delphi and C++Builder examples

Editions

All editions draw on the same core library. Specialised workflows come from separate packages in Small Business and Enterprise; wherever this page relies on one of those, the feature carries an edition label

Edition Package What it adds
Standard HotPDF The whole core library: generation, editing, fonts and shaping, forms, encryption, in-process PFX signing with signature verification, the PDF/A, PDF/X and PDF/UA gates, rendering, imaging, report-engine adapters and the Direct File API
Small Business HotPDFSB (Lib\SmallBusiness) EN 16931 e-invoice business rules, plus contract and document comparison
Enterprise HotPDFEnt (Lib\Enterprise), plus HotPDFSB Preflight reports and validation plugins, batch signature validation, PKCS#11, CSC, remote and CNG signing providers, DSS / VRI evidence writers, B-LTA document timestamps, PAdES profile preflight, archival PDF/A-4 repair, the C ABI (HotPDFABI.dpr and hotpdf_abi.h) and JSON jobs

Creating and Laying Out Documents

  • PDF files can be created, pages added, text and vector graphics drawn, and results saved either to files or to streams the caller owns
  • Y-coordinate semantics for page text are controlled through THPDFPage.TextFromBaseLine, expert raw PDF operators can be contained with AppendScopedRawContent, and wrapped text-box output is queried through TextOutBoxEx / WideTextOutBoxEx
  • Layout elements are reusable and support side-effect-free measurement, verified split heads and owned overflow continuations across paragraphs, rows, containers and custom content; backgrounds, headers, document content, footers and foregrounds are composed in a stable order by declarative page callbacks, and file-backed page staging, paragraph constraints, bounded diagnostics, semantic helpers and bidi direction control are kept for unbounded reports
  • HTML5 paged media can be imported with a tolerant DOM, a print CSS cascade, measured paragraph layout for mixed RTL runs, widow and orphan constraints, optional hyphenation, tables, nested flex/grid business panels, wrapping rows, column spans, images and optional AcroForm controls, callback-controlled sfnt font resources, and bounded parser, layout, resource and decoded-image budgets
  • SVG imports as reusable Form XObjects, with native geometry, CSS, gradients, dash strokes, Alpha and Luminosity soft masks, measured Unicode text, embedded PNG/JPEG images, placement-aware links and strict parser and resource budgets
  • RichEdit and RTF content is paginated through the Windows formatting engine, keeping vector text, fonts, images, supported OLE presentations and explicit resource budgets
  • Native vector charts render line, bar, area, pie and scatter series, with automatic or manual axes, themes, legends, labels, bounded data and optional PDF/UA Figure alternatives
  • XPS, EPUB and CBZ are converted and rendered through optional content-scored handlers that keep fixed-page, spine or natural image order; XPS paths, gradient, image and VisualBrush brushes, opacity masks, clipping, Glyphs runs with the exact package fonts and navigation links all become native PDF content under shared archive, resource and output budgets
  • JPEG, bitmap, TIFF, JPEG2000, JBIG2, WMF and EMF image workflows can be imported and written, with encoded image XObject reuse, image-mask and soft-mask transparency helpers, per-image JPEG quality overrides, per-call EMF/WMF rendering options, frame clipping, hatch-brush pattern preservation and opt-in automatic monochrome compression selection
  • Metadata, annotations, popup comments, hyperlinks, attachments, viewer preferences, all six standard page layouts (including two-page cover spreads), print behaviour, layers and page transitions can be added
  • Annotations cover highlights, free text, links, file attachments, popups, redaction, watermark, rich media, 3D / U3D / PRC, border styles, linked comment popups, and the complete Line / PolyLine / Polygon extras family (caption, line endings, intent, border effect)
  • Named destinations and page thumbnails are supported, outline styling is available per page (colour, bold, italic), and a document-level named JavaScript registry is provided
  • Navigation metadata for generated documents: catalogue /PageLabels ranges are written by THotPDF.SetPageLabel and its decimal, roman and alphabetic helpers through THPDFPageLabelStyle, whilst article thread dictionaries and bead chains come from RegisterArticleThread plus THPDFPage.AddArticleBead
  • Document lifecycle, page, form, annotation, layer, multimedia, transition, 3D-view and GoToE embedded-navigation actions are all available from THPDFActionBuilder, with ordered /Next chains; all 18 standard action types can be inspected safely through the loaded action graph API
  • Catalogue document lifecycle additional actions /AA /WC, /AA /WS, /AA /DS, /AA /WP and /AA /DP are written through THotPDF helpers, and page-level /AA /O and /AA /C triggers through THPDFPage.SetPageAdditionalAction and THotPDF.SetPageAdditionalAction; matching clear helpers exist for each
  • Tagged PDF structure trees come with role maps, StructParents and ParentTree output, the Table 333 standard structure-type enum (THPDFStandardStructureType), an AddStructureElement typed overload, and /Lang, /Alt, /ActualText and /E properties on BeginTaggedContent
  • OutputIntents, ICC profiles, page boxes, rotation, UserUnit, Tabs order, tiling patterns, ExtGState alpha, blend modes, inline images, multi-stop axial and radial gradients, Gouraud-shaded triangle meshes, Coons and tensor-product patch meshes, and soft-mask images giving PNG-style per-pixel alpha are all supported
  • Fast web view output is an opt-in through the LinearizeOutput writer, which adds a first-page dependency section, shared-object grouping, primary page and shared-object hint tables and an early compatibility cross-reference table whilst direct file and stream destinations are retained
  • Layout visual diagnostics can be inspected, with bounded overlap detection, element paths, opt-in source mapping, native vector overlays, statistics and synchronous preview callbacks

Fonts, Shaping and Text

Shaping happens on the producer side in HotPDF, driven by the font's own OpenType tables, and the result is emitted with standard PDF text operators. Output is therefore identical in every PDF reader, and copy and paste recovers the original characters because full /ToUnicode reverse mapping is written

The OpenType GSUB Substitution Engine

LookupTypes 1-8 of OpenType GSUB are all implemented (Single, Multiple, Alternate, Ligature, Contextual, Chained Contextual, Extension, Reverse Chained Contextual), together with Script / LangSys selection, GDEF parsing, Cmap format 12 SMP coverage and query helpers such as GetSingleSubstituteGlyph, ApplyLigatureSubstitution, ApplyContextualSubst and ApplyReverseChainedContextualSubst. Every substitute glyph is pulled into the subsetter by MarkUnicodeGlyphUsed, so embedded font subsets remain self-contained

The OpenType GPOS Positioning Engine

All 9 GPOS LookupTypes are covered by the positioning engine: pair, single and contextual kerning in both left-to-right and right-to-left text, mark-to-base, mark-to-mark and per-ligature-component mark-to-ligature placement, cursive entry and exit attachment, distance positioning, and vkrn / vpal vertical kerning for vertical text output

Complex Scripts

More than 20 scripts are shaped through the font's own GSUB feature chain, among them Arabic with its Supplement, Extended-A and Extended-B blocks, Syriac, Mongolian, N'Ko, Adlam, Hanifi Rohingya, Tibetan stacking, Devanagari and the other Indic scripts, Javanese, Thai, Lao, Hebrew, Khmer, Myanmar, Tai Viet and Meetei Mayek. None of them is on by default: each script is an opt-in switch, and existing output stays byte-identical until the switch is thrown

Automatic Shaping Pipeline

Arabic init / medi / fina / isol, rlig, calt, rclt, GPOS cursive attachment, Latin liga / clig and Devanagari reordering are applied whilst text is emitted, through the opt-in ShapingFeatures property and the THPDFShapingFeature enum (sfArabicGSUB, sfCursiveAttachment, sfStandardLigatures, sfContextualLigatures, sfContextualAlternates, sfIndicShaping). The full U+0672-06D5 joining-class table is covered for Arabic as well, with ligature folding for LAM-ALEF, YEH-HAMZA, Allah (U+FDF2) and Bismillah (U+FDFD)

Automatic OpenType Typography

Optional switches apply the font's standard, discretionary and historical ligatures, small capitals, oldstyle, lining, proportional and tabular figures, superscripts, subscripts, ordinals, fractions, scientific inferiors, numerators, denominators, stylistic and contextual alternates, localised forms, case-sensitive forms, slashed zero and vertical alternates, and chained substitutions are resolved back to the source text in the ToUnicode CMap

Synthetic Codepoints and Capability Surfaces

Where a GSUB substitute glyph has no natural Unicode codepoint, Private-Use-Area codepoints (U+E000-F8FF) are allocated by AssignSyntheticCodepointForGID and GetSyntheticCodepointForGID, with mirrored /CIDToGIDMap, /W and /ToUnicode integration. ApplyLatinLigatureRefinement handles Latin ligatures, and callers can drive emission glyph by glyph through GetSyriacJoiningClass, GetMongolianJoiningClass, GetDevanagariCategory, ApplyDevanagariReorder, GetUnicodeGlyphForCodepoint and GetCodepointAdvance

Font Subsetting and CJK PDFs

TrueType, OpenType-CFF, CID-keyed CFF and CFF2 fonts are subset by THotPDF.EnableFontSubsetting, with glyph IDs preserved for Type0 / Identity-H text. CJK documents that used to embed 14 MB CID-keyed CFF programs now ship at 500 KB - 2 MB and lose no rendered glyphs, whilst optional compact TrueType subsets renumber the glyphs that are kept, so a handful of CJK characters costs only a few kilobytes of font data

Variable and Colour Fonts

Before embedding, built-in instancing for TrueType and CFF2 variable fonts bakes TrueType gvar outlines and phantom points, CFF2 blends, mapped axes, and horizontal, vertical and global metrics into a static sfnt with a correct checksum. Colour glyphs are drawn from native COLR v1 paint graphs with gradients, transforms and blend composites, from bounded SVG glyph paths and shapes with fail-closed active-content rejection, and from closest-strike sbix and CBDT/CBLC bitmaps

Compact Font Output

Font programs are always Flate-compressed when embedded, a font that appears on several pages is embedded once for the whole document, and subset tags are derived deterministically from the glyphs actually used so that repeated runs give identical output. Plain-ASCII text with standard fonts can be written as compact unembedded WinAnsi text in an optional mode, and compact subsets, Flate compression and object streams are combined by the single CompressDocument switch

Editing PDFs You Already Have

Pages, Merging and Assembly

Existing PDFs can be loaded, pages or page ranges copied, appended and deleted, documents merged with outline-aware and AcroForm-aware merging, document information updated, pages stamped, and loaded streams transcoded with compression-level-aware Flate compression or predictor-safe decompression. Resource deduplication works destination-wide across page imports from several documents

Lossless Content-Stream Editing

The THPDFContentStreamAST keeps every whitespace byte, comment, delimiter, operand spelling and inline-image payload whilst linked operation and container nodes are exposed; bounded inspect, measure, replace, delete, stop and reject callbacks with validated atomic loaded-page updates come from content operator visitors, and operands are canonicalised by semantic comparison before events are compared exactly

Text Replacement and Paragraph Editing

Unicode text replacement can be previewed and relies on embedded fonts, document shaping settings, width policies, wrapping, per-match results, stale-plan detection and atomic commits, touching only the matched operand spans. Selected text is reflowed by bounded paragraph editing across baselines and supported shared Form invocations, with collision reports, a sealed preview, commit and rollback

Redaction

Redaction is clipped at boundaries and covers text, paths, images, patterns, inline images and Form XObjects; a full rewrite removes unreachable resources, metadata, attachments, annotations and prior revisions. Review-first redaction detection pairs checksum-aware PII patterns with application-selected entity and face detectors, staging only findings that carry explicit approval and reviewer identity, and a separate burn-in boundary is maintained

Colour Rewrite and Flattening

Selected paint is converted by loaded-page colour rewrite to DeviceGray, DeviceRGB or DeviceCMYK, leaving ordinary text and paths as searchable vectors. Seam-free lossless tiles with bounded peak working memory come from colour-managed transparency flattening, and adaptive mesh-shading and complex-pattern flattening is chosen by measured perceptual error

Sanitising and Transactions

JavaScript-only, active-content or strict untrusted-document policies are applied by SanitiseLoadedDocument, which also removes unreachable payload objects, compacts live object numbers and rewrites in place through atomic file replacement. Each touched indirect root is snapshotted once per savepoint by nested copy-on-write object graph transactions, object-number allocation is restored on rollback, and large stream history spills beyond a configurable threshold

Revisions and the Object Graph

Xref free lists and generation transitions are validated by revision-aware loading, destructive incremental edits build a complete deterministic free chain, and low-memory post-save cache release is supported by explicit clean, dirty, released and must-write object states. Structural inspection is reproducible through streaming versioned object graph JSON snapshots and incremental updates and through editable QDF diagnostic output with bounded stream-length and xref repair

Loaded-Document Toolkit and Viewer

Annotation editing covers multi-widget form geometry, visibility, rotation, border and colour; bare web and email addresses can be activated, stateless next-match search runs, typed outline snapshots are read, and printing is deterministic with paper capability discovery. Full-page, region and pixel-bounded snapshots, adjacent-page prefetch, persistent highlights, rotation-aware marquee selection, and keyboard and wheel navigation come from the VCL viewer components

Working with Forms and XFA

AcroForm Creation

  • Text fields, list boxes, combo boxes, check boxes, radio buttons, signature fields and push-button actions (Named, Hide, Show, ImportData and SubmitForm, with user-controlled /Flags) are supported, with appearance streams generated for multi-line, comb, rich-text and CID-font fields
  • Authored text-field UTF-8 WinAnsi appearances work on single lines, multiline paragraphs and comb cells, with password masks counted in Unicode scalars and stored values left unchanged
  • The whole form-field trigger family is available (/AA /K Keystroke, /F Format, /V Validate, /C Calculate), as are widget mouse, focus and visibility triggers (/E, /X, /D, /U, /Fo, /Bl, /PO, /PC, /PV, /PI) by field name, each with matching clear helpers
  • Multi-Unicode /DR font registration goes through RegisterAcroFormFont, and duplicate field names are guarded against at creation time

Loaded Forms and Data Exchange

  • Form questions on a loaded PDF are answered by HasFormFields and FormFieldExists before the file is touched, field values can be read and written by index or by name, and FlattenFormFields burns fields into page content and reports the count it flattened
  • Separate selections in multi-select choice fields survive FDF file and stream exchange and XFDF multi-value exchange, and Windows FDF and XFDF imports pick the supplied font families and styles whilst signed or AES-encrypted revisions are preserved
  • Calculation and validation actions run a bounded typed expression subset with deterministic UTC dates and allowlisted helpers, and unsupported active scripting fails closed without starting a JavaScript engine; broader application-controlled JavaScript runs under memory, stack, time and interrupt limits through the optional QuickJS runtime bindings
  • Native Unicode AcroForm appearances fill single-line fields with embedded TrueType, exact glyph widths and supplementary ToUnicode, whilst native typed form no-op publication keeps exact bytes for updates that changed nothing
  • Supplied rich-text font fallback picks complete styled Unicode graphemes from candidate family programs, and the same behaviour is opt-in through native Linux JSON fallback

XFA Containers and Flattening

  • XFA (XML Forms Architecture) container packets (PDF 1.7 §12.7.6 / §12.7.8) are written with AddXFAPacket, ClearXFAPackets and XFAPacketCount, and XDP-stream and packet-array DOM queries and edits preserve exact bytes
  • Static XFA becomes native AcroForm fields through XFA-to-AcroForm flattening (ApplyXFAAsAcroForm for raw XDP bytes, FlattenLoadedXFA for a loaded PDF's embedded form): styling, flow-measured nested layout="tb", wrapped layout="lr-tb", fixed-column and auto-column table rows, and page graphics are all produced, so the form stays usable in readers that have no XFA engine
  • Legacy XFA radio groups, legacy XFA choice fields, and legacy text, numeric, date and password fields produce real Unicode font appearances, with repeated-instance scopes and per-field rollback
  • Embedded-font line metrics keep selected options visible in native XFA list selection windows, and the top index is saved together with complete option and value arrays

Dynamic XFA Runtime

  • XFA form scripting adds conditional logic and validated instance callbacks to bounded FormCalc, and an explicitly enabled QuickJS sandbox provides full control flow without exposing file, process, browser or network objects
  • Host-neutral focus, Unicode editing, hit testing, validation and calculation, atomic rollback and bounded reflow without flattening are added by the interactive dynamic XFA runtime; dynamic instance add and remove, and presence events, persist to XDP output
  • Repeated data binding, stable identities, live lists and native appearances stay consistent across saves through dynamic XFA instance presentation and dynamic XFA choice items
  • Lexical state is retained, with bounded and deterministic transactional rollback, by persistent XFA JavaScript sessions, persistent event and script-object handles, dynamic FormCalc Eval and owned native FormCalc execution
  • Bounded resident records, native and JavaScript dataWindow navigation, a disk-backed structural journal, record retention, logical-order and neighbour queries, and complete XDP saving that preserves evicted edits are all provided by document-owned XFA XML streams
  • Typed callbacks for host actions and for FormCalc Get/Post/Put are supplied by XFA host transport, which records responses for safe retries and replay

Security, Encryption and Signatures

Encryption and Permissions

Passwords, AES-128, AES-256, PDF 2.0 AES-256 R6, public-key encryption through caller-supplied PKCS#7 envelopes, metadata-encryption control, protection flags and permission control are all available. Strings, normal streams and embedded files are covered by independent reserved crypt-filter policies, and password copies, derived keys and plaintext scratch are cleared on every success and failure path

Standard and public-key encrypted incremental updates written by HotPDF preserve credentials, keeping stable permanent IDs and byte-exact source prefixes; authenticated public-key incremental saves with independent string and stream recipient keys are included

In-Process PFX / PKCS#12 Signing

A single call to THotPDF.SignPDFWithPFX(InputPDF, OutputPDF, PFXFile, Password) signs an existing placeholder PDF. RSA and ECDSA are signed natively by the bundled ASN.1, RSA, AES and PBES2 PKCS#12 stack, whilst Ed25519 and Ed448 go through optional OpenSSL 3 libcrypto, with SHA-2, SHA3 or SHAKE256 digests, 256 KB bounded copy buffers and same-stream signing. Multi-identity credentials are selected deterministically by HPDFEnumeratePFXIdentities, HPDFParsePFXByLocalKeyID and THPDFCMSSignOptions.PFXLocalKeyID, which carry the matching available certificate chain into CMS. PBES2 unwrapping accepts AES-128, AES-192 and AES-256 CBC with HMAC-SHA-1, SHA-256, SHA-384 and SHA-512 PBKDF2 profiles, and legacy PBE-SHA1-3DES PFX files are still read

CMS and Signature Verification

Multi-signer CMS containers keep independent attributes, algorithms, certificates, providers and validation results, and signers may use issuer-and-serial or compact X.509 SubjectKeyIdentifier identities. Loaded-signature verification covers RSA PKCS#1 v1.5, RSA-PSS, NIST and Brainpool ECDSA, Ed25519, Ed448, SHA-2, SHA3 and SHAKE256, RFC 3161 timestamp tokens, caller-controlled certificate paths, offline OCSP or CRL validation, and machine-readable diagnostics

PAdES Long-Term Validation

PAdES B-B, B-T, B-LT and B-LTA are covered end to end: SHA-2 or SHA3 RFC 3161 signature and document timestamp verification, append-only archive timestamp renewal with caller-supplied DSS certificate, OCSP and CRL evidence, exact evidence deduplication across revisions, DSS / VRI validation, caller-supplied trust anchors, Seed Value constraints, ISO 32001 extension declarations and XAdES-in-PDF. Enterprise edition: the DSS / VRI evidence writers, B-LTA document timestamps and PAdES profile preflight all need HotPDF Enterprise (HotPDFEnt)

Signature Policies and Profiles

PAdES signature-policy validation covers PAdES E-EPES policy generation, structured qualifiers, policy-document hashing and caller pinning, and PAdES profile preflight reports every baseline or extended requirement with clause, CMS, DSS, timestamp, object and revision evidenceEnterprise

Signing Providers and Remote Signing

Application callback signers plug into the CMS pipeline, and remote, PKCS#11 and Windows CNG key-storage providersEnterprise take the same route. CSC remote signing reaches CSC API v2 services through an application-owned HTTP transport, with OAuth refresh, hash-pinned SAD handling, bounded multisign batches and idempotency keys. Previous signatures are retained whilst existing fields are filled by incremental signing jobs

Timestamps and Revocation

Timestamp, OCSP and CRL acquisition is asynchronous and bounded, with cancellation and retry policy. Message imprints, nonces, TSA authorisation and revocation evidence are validated by headless RFC 3161 timestamps, and chains plus OCSP/CRL freshness are validated before incremental publication by headless DSS/VRI evidence, encrypted documents included

PDF MAC and Integrity

The complete incremental-revision chain is validated by algorithm-agile standalone and signature-attached PDF MAC, with exact failure locations, authenticated permissions and SHA-2 or SHA-3 policy enforcement. Before any document hashing or provider work, inconsistent signer, container, key-length or RFC 6211 algorithm identifiers fail

Standards Conformance

Practical PDF 1.3, PDF 1.4, PDF 1.5, PDF 1.6, PDF 1.7 and PDF 2.0 authoring features used by business, imaging, publishing and document-automation applications get version-specific support in HotPDF. Generated files avoid newer entries when strict compatibility is needed because public APIs are checked against the selected PDF version, and output version promotion or strict conformance can be enforced automatically by the version gates through StrictVersionLock

Coverage is broad and standards-aware across the authoring surface HotPDF supports; it is not a blanket claim that every edge case in ISO 32000-1 has been implemented

PDF/A, PDF/X and PDF/UA Conformance

Feature methods are gated against PDF/A-1, -2, -3, -4, -4e and -4f, PDF/X-1a, -3 and -4, and PDF/UA-1 and -2 profiles, and a bounded object-graph validator runs before PDF/A-4 is serialised. A call that would break the selected profile raises a diagnostic exception rather than producing a non-conformant PDF without warning

PDF 2.0 Profiles

PDF/A-4, PDF/A-4e, PDF/A-4f, PDF/UA-2, PDF/X-6, PDF/X-6p and PDF/X-6n identification and validation are supported in PDF 2.0 output, with selectable ISO 15930-9:2020 and resolved-errata PDF/X-6 rule sets, checks on actual painted colour and overprint, clause-aware diagnostics, and transactional PDF/A-4 and PDF/UA-2 repair with byte-exact rollback

Accessibility

Tagged PDF 2.0 tables get grid expansion, header association and cycle detection, lists get numbering and continuation checks, Ruby and Warichu sequences are enforced, and pronunciation hints or embedded PLS lexicons can be written through SetStructurePronunciation and AddPronunciationLexicon

Preflight ReportsEnterprise

A PDF is audited against the supported PDF/A, PDF/X and PDF/UA checks by CreatePreflightReport and CreatePreflightReportWithProfile, which emit text, JSON, HTML, CSV or XML reports with stable namespaced rule identifiers and structured locations. One deterministic XML MRR is produced by ValidatePDFWithPluginBundle and CreatePreflightMRR, combining built-in policies with bounded trusted feature and rule plugins. HotPDF Enterprise is required (HotPDFEnt / Lib\Enterprise)

Validation Policies and E-Invoices

Structural preflight is combined with strict or WTPDF intake requirements in reusable validation policies, and ordered file batches run under bounded worker limits. Attachment MIME types, FileSpec names and XMP namespaces are cross-checked by Factur-X and ZUGFeRD intake, and every profile-specific Schematron check is run by built-in e-invoice business-rule validationSmall Business

Archival Conversion

Original text, vectors, images, embedded fonts and OCR layers are retained by loaded PDF/A-4 preservation, which reports interaction and metadata losses. Visible pages are rebuilt as verified sRGB images under resource budgets by loaded PDF/A-4 raster archival conversion; original vector text, signatures and interactive content are discarded on this opt-in visual path

Filters and predictors, XRef streams, incremental update chains, Ed25519, Ed448, extension-gated ML-DSA verification, DeviceCMYK and ICCBased colour, layers, transparency groups, XMP metadata, OutputIntents, production page boxes, ViewerPreferences, UserUnit, Tabs order and font embedding for TrueType, Type 3, CFF, OpenType-CFF and CID-keyed CFF fonts are covered by the standards matrix as well

Extraction, OCR, Barcodes and Comparison

  • Character-level extraction that carries transformed quadrilaterals, baselines, source clusters and ligature membership
  • Semantic text extraction that keeps stable column order, table rows, lists, headings and figure or table captions
  • Embedded sfnt cmap tables, AGL glyph names, binary CIDToGID maps and Adobe CID collections are all mined for missing ToUnicode; one-to-four-byte character codes are decoded by the built-in legacy CMaps, and the complete CMap data notice ships for redistribution
  • Structured loaded-page export writes UTF-8 HTML, XHTML, XML or JSON from a single accessible reading model, keeping headings, lists, tables, figures, outlines, page labels and safe links
  • Typed table extraction forms a canonical grid across fragments and pages, infers locale-controlled numbers, dates, currencies and percentages with confidence, and writes CSV or JSON atomically
  • Paragraphs and word or sentence tokens are compared in contract wording, two-sided source positions are retained, clause reordering is detected, explicit boilerplate can be excluded, and HTML or annotated PDF review output is producedSmall Business
  • Six comparison modes and two-sided contract JSON, HTML and annotated-PDF artefacts are exposed by two-document comparison jobs
  • An application-selected recogniser is wired to bounded rendering by searchable OCR text layers, which invert page rotation for aligned invisible text, optionally bind output to a single OCG and commit all pages in one transaction; the SearchableOCR console example demonstrates the built-in, RapidOCR and Tesseract engines
  • Regular, bold, italic and bold italic ASCII text is recognised by the built-in OCR engine, and uncertain words are omitted as a whole rather than silently dropping characters
  • Multilingual Unicode recognition, page segmentation modes, confidence and baselines come from the native Tesseract DLL adapter (HPDFCreateTesseractDLLOCREngine) and the local CLI adapter (THPDFTesseractOptions)
  • ONNX models run offline for Chinese, Japanese, Korean, Latin, Russian, Arabic and Hindi text through the RapidOCR local model adapter (THPDFRapidOCROptions) and the native RapidOCR DLL adapter (HPDFCreateRapidOCRDLLOCREngine, THPDFRapidOCRDLLOptions.ForLanguage)
  • Orientation detection, deskew, border cleanup, perspective rectification and semantic text output are added by scan preprocessing and structured OCR; the external engines are exposed through explicit settings in JSON and C ABI OCR jobs
  • Pages or regions are rendered in bounded slices for pluggable decoders by loaded-page barcode decoding, with built-in Code 39, Code 128, EAN/UPC, QR, Data Matrix ECC 200 and PDF417, and results are mapped back into PDF user space
  • Multiple barcodes in one raster can be recognised, identical payloads at separate locations are preserved, and rotated or projective Data Matrix modules are sampled

Rendering, Imaging and Colour

Loaded-Page Renderer

One content-token interpreter with per-operator cancellation is shared by bitmap, direct-DC, Form and display-list replay. Coloured and uncoloured tiling patterns of all three tiling types are executed with each cell path isolated, along with axial, radial, Gouraud, Coons and tensor-product patch shadings, executable halftones, transfer functions, and black generation / under-colour removal, all with bounded recursion and tessellation when resources are hostile

Colour Management and Transparency

Source, proof, output and sRGB pipelines are applied in ICC-based rendering with selectable intent and black-point compensation through a shared transform cache, and images and groups carry native rendering intents. Bounded tiles report through GetLastTransparencyGroupTileStats for isolated and knockout groups, and opt-in overprint proofing keeps process plates that a paint does not name, applies /OPM 1 zero-component protection and combines Separation and DeviceN spot tints

Parallel and Progressive Output

Display-list compilation and playback overlap in parallel rendering; ordered pages, tiles or bands are streamed by RenderLoadedPagesParallelOrdered, RenderLoadedPageTilesParallel and RenderLoadedPageBandsParallel with borrowed bitmap lifetimes, and stage telemetry is reported through THPDFParallelRenderPipelineInfo. Early progressive JPEG scans are shown by THPDFLoadedPageRenderSession through THPDFProgressiveJPEGScanEvent, and only requested regions are rendered; SaveLoadedPageToPng / SaveLoadedPageToPngStream and SaveLoadedPagesToTiffBanded / SaveLoadedPagesToTiffStreamBanded encode without a full framebuffer

Pluggable Backends and Caches

Compiled display lists are handed to pluggable loaded-page render backends, which advertise their capabilities, whilst existing output is preserved by the built-in GDI backend. Bounded caches with reference-counted bitmap handles serve decoded images, display lists, raster pages, Type 3 CharProcs and prefetch work; compiled lists expose THPDFPageDisplayList.OperatorCount, and prefetch reports through THPDFLoadedPagePrefetchInfo

JPEG 2000, JBIG2 and CCITT

Codestream tiles are validated during JPEG 2000 decoding, region and resolution-of-interest reconstruction are combined, and visible tiles are decoded through budget-aware parallel tile reconstruction. Decoding is preceded by JBIG2 segment-graph validation, one trained global dictionary is shared across pages in batch encoding, and CCITT Group 3 and Group 4 streams decode with bounded damaged-row resynchronisation

Performance with Large Files

Multi-Gigabyte Direct File API

The DAOpenFileReadOnly / DACopyFile / DASetDocumentInfo / DASaveAsFile family and the file-to-file EncryptFile / DecryptFile calls act on the PDF file directly rather than building the in-memory object graph. With a 2 GB benchmark document holding 1.67 million objects, AES-256 encryption needs roughly 14 seconds, decryption roughly 16 seconds and a full rewrite roughly 6 seconds, and the page count of a 1.25 GB document is available in milliseconds

Memory-Mapped and Random-Access Loading

Bounded adaptive memory mapping with a shared LRU cache is used for large local files, and THPDFMappedFileStatistics reports on it. HTTP range readers and custom storage are connected by LoadFromRandomAccessSource, which coalesces reads, adapts read-ahead and plans minimal ranges for linearised or later pages without asking for the complete source

Bounded Damaged-PDF Recovery

After a broken startxref, intact xref tables or streams are relocated, and a token-aware 1 MiB chunk scanner then rebuilds direct-object offsets with configurable byte and object budgets, newest-definition precedence, stream-body false-positive filtering, byte-ranged confidence events, and a mandatory full rewrite on save

Memory Scheduling

Competing loads, renders and optimisation jobs are delayed by a fair process-wide peak-memory scheduler until there is no overlap between their working sets. Above LoadedStreamMemoryThreshold modified streams move to compressed temporary storage, and object-stream members are parsed only once referenced

Stream Filters and Optimisation

Strict end markers, decoded-byte ceilings and cycle detection govern the reusable pipeline that loaded stream filters run through, and application-defined decoders join it under the same budget through the IHPDFCustomStreamFilter registry. zlib, Zopfli and bounded JPEG / JPEG 2000 quality trials are combined in selective optimisation, and only smaller payloads are committed

Hardened Parsing

A retained block arena backs parser tokens, dictionaries and arrays scan immutable spans, and configurable byte, token, container-entry and malformed-token budgets halt hostile input with typed telemetry. A bounded document-scoped pool is shared by repeated names, operators and short strings

Platforms, Bindings and Integration

Four Report-Engine Adapters

FastReport (TfrxHotPDFExport, with the frxHotPDFDesign design-time unit), QuickReport (TQRHotPDFExportFilter), ReportBuilder (TppHotPDFDevice) and DevExpress ExpressPrinting (dxHotPDFExportReportLinkToFile/Stream, covering cxGrid / cxRichEdit / cxScheduler / cxPivotGrid) all get drop-in PDF backends. Existing reports keep working and only the PDF emitter is replaced, with native object output and opt-in PDF/A and PDF/X gates; a VCL TDBGrid table exporter is included

Native Linux C ABI

The versioned native Linux C ABI delivers text, form, PNG and encrypted signing operations through bounded callbacks, and real C and Python clients run on Ubuntu 24.04, Ubuntu 26.04 and Debian 12

Windows C ABI and JSON JobsEnterprise

A versioned flat C ABI with layout-checked Win32 and Win64 callbacks, opaque handles, fixed status codes and cancellation is exposed by HotPDFABI.dll, which build-HotPDF-ABI.cmd builds for each platform. Rendering, text and forms, OCR, redaction, signing and PDF/A-4 conversion are shared by JSON and C ABI document operations through a versioned schema with atomic output

Free Pascal and Lazarus

Building Free Pascal from the full source needs FPC 3.2.2 or later on every platform (whilst the Trial's precompiled Win32 and Win64 units call for the official default Free Pascal 3.2.2 release). TIFF, JPEG/JPX, ICC, JBIG2 and Zopfli come via FPC native backends through a validated Windows codec bridge, together with parallel page, tile, band and JPEG 2000 tile rendering

Diagnostics and Quality Control

  • A runtime-toggleable diagnostic facade is provided by THPDFLogger and the global HPDFLog, with Error / Warning / Info / Debug filtering, file, OutputDebugString and console targets, thread safety, 10 MB rollover and a disabled path that costs nothing
  • Scheduler queue delay, wall and CPU time, retained memory, process I/O, cache activity and decode expansion are separated in unified operation telemetry
  • Cancellation checkpoints, range availability and callback outcomes are captured in bounded deterministic replay logs, so intermittent behaviour can be reproduced
  • Engines are compared across parse, render, text and save domains by deterministic differential regression probes, which emit the hotpdf.differential.v1 JSON schema
  • The native statistical performance regression harness records warmups and 30 raw samples with p50, p95, RSS and process I/O, and fails against versioned JSON thresholds
  • Failures are re-minimised by continuous malformed-PDF corpus storage, and SHA-256-addressed hotpdf.corpus.case.v1 cases are published atomically

Documented automated controls exist for implemented profiles; acceptance applies to the tested compiler, source composition, platform and behaviour identified in each record. Remaining capability and integration boundaries are tracked in the capability completion plan

Compression and Imaging Stack

The bundled Flate backend uses zlib-ng in zlib-compatible mode, and page streams, embedded fonts, ToUnicode CMaps, Flate images, TIFF output and FlateDecode helpers all route through the HotPDF zlib layer. Runtime CPU dispatch for SSE2 through AVX2 paths with generic fallbacks is included in Win64x builds, whilst Win32 uses the generic zlib-ng OMF object set

Standard JPEG workflows go through the libjpeg-compatible API in HPDFJpeg.pas and the bundled libjpeg-turbo 3.1.90 object set, with NASM SIMD objects on Win32, Win64 and Win64x; the same backend serves JPEG-compressed TIFF. SIMD-friendly buffers get 32-byte aligned allocation from the C runtime bridge in HPDFCLibs.pas

For the full native C library set there are reproducible object build scripts: Lib\thirdparty\build-bcc32.bat, Lib\thirdparty\build-bcc64x.bat and Lib\thirdparty\build-vc64.bat, plus zlib-ng-only scripts for focused rebuilds

Getting Started

Delphi

program HelloHotPDF;

uses
  System.SysUtils,
  HPDFDoc;

var
  PDF: THotPDF;
begin
  PDF := THotPDF.Create(nil);
  try
    PDF.AutoLaunch := False;
    PDF.FileName := 'HelloHotPDF.pdf';
    PDF.Compression := cmFlateDecode;
    PDF.EnableFontSubsetting := True;
    PDF.BeginDoc;
    PDF.CurrentPage.SetFont('Arial', [], 18);
    PDF.CurrentPage.TextOut(50, 50, 0, 'Hello HotPDF');
    PDF.EndDoc;
  finally
    PDF.Free;
  end;
end.

C++Builder

#include <vcl.h>
#include "HPDFDoc.hpp"
#pragma hdrstop

int main()
{
  THotPDF* PDF = new THotPDF(NULL);
  try
  {
    PDF->AutoLaunch = false;
    PDF->FileName = "HelloHotPDF.pdf";
    PDF->Compression = cmFlateDecode;
    PDF->EnableFontSubsetting = true;
    PDF->BeginDoc();
    PDF->CurrentPage->SetFont("Arial", TFontStyles(), 18, 0);
    PDF->CurrentPage->TextOut(50, 50, 0, L"Hello HotPDF");
    PDF->EndDoc();
  }
  __finally
  {
    delete PDF;
  }
  return 0;
}

What Ships in the Package

Current RAD Studio generations, including 13.1 Florence, are covered by ready-to-use Delphi and C++Builder package projects

Where HotPDF Fits