HotPDF 2.456.0 for Delphi and C++Builder

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

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

Project Overview

HotPDF is a source-level PDF component library for Delphi and C++Builder. It is built for desktop software that needs deterministic PDF output, direct page drawing, strong RAD Studio integration, and compact deployment.

The component covers everyday PDF generation, advanced document assembly, PDF editing, image-heavy output, forms with duplicate field-name guards, annotations, creation-time AcroForm field wrappers, reusable action-builder chains for open actions, document lifecycle actions, page additional actions, annotation actions, annotation additional actions, AcroForm additional actions, encryption, signing workflows, font optimization, and stream-based workflows from a single native API surface

The loaded-document toolkit adds page-range deletion, outline-aware and AcroForm-aware merging, multi-widget form constraint, geometry, visibility, rotation, border, and colour editing, complete annotation editing, automatic activation of bare web and email addresses, stateless next-match search, complete typed outline snapshots, Windows certificate-store signing, deterministic collated printing with paper capability discovery, full-page, bounded-region, and pixel-bounded Viewer snapshots, cache-aware adjacent-page prefetch, persistent page highlights, rotation-aware marquee selection, current-view printing, keyboard and wheel navigation, and VCL viewer components

Recent library releases expanded HotPDF from a classic PDF writer into a broader native PDF toolkit covering version-specific PDF 1.3 / 1.4 / 1.5 / 1.6 / 1.7 feature gating, native PDF 2.0 output, PDF/A-1 / -2 / -3 / -4 + PDF/X-1a / -3 / -4 + PDF/UA-1 / -2 standards conformance, PAdES baseline / extended / long-term-validation digital signatures, an in-process PFX / PKCS#12 signing pipeline that does not depend on OpenSSL or external native binaries, incremental update saving with stable permanent IDs, rotating modification IDs, and byte-exact no-op saves, CFF / OpenType / CID-keyed CFF font subsetting, and PDF export adapters for FastReport, QuickReport, ReportBuilder, and DevExpress ExpressPrinting that route their existing reports through HotPDF as a single PDF backend. A Direct File API processes multi-gigabyte, million-object PDFs file-to-file - page counts, copies, document-information rewrites, and AES-256 encryption or decryption - in seconds, while the bounded recovery loader can relocate a valid xref section or rebuild direct-object offsets after damaged startxref and xref data without trusting nested object-like text or binary data

The opt-in LinearizeOutput writer adds fast web view output with a first-page dependency section, shared-object grouping, primary page and shared-object hint tables, and an early compatibility cross-reference table while retaining direct file and stream destinations

Loaded stream filters run through a reusable pipeline whose final stage writes directly to caller-owned streams and whose intermediate stages spill from memory to temporary files, with strict ASCII85 and ASCIIHex end markers, independent per-chain and document-wide decoded-byte ceilings, filter-count and pipeline-depth limits, indirect-reference cycle detection, same-stream recursion rejection, and structured diagnostics for every success or failure

Predictor encoding now exposes strict reusable TIFF and fixed or adaptive PNG paths for packed, 8-bit, and 16-bit rasters; loaded images can copy native or generically decoded payloads directly to caller streams, while selective optimization uses memory-to-disk spill buffers, deterministic four-strategy high-ratio Flate selection, and bounded parallel image jobs that commit only smaller payloads in source order

Large loaded streams remain source-file windows until mutation and can expose independent read-only source slices without copying; after mutation they use the configurable LoadedStreamMemoryThreshold to select memory or an owned temporary file; object-stream members are indexed by object number and parsed only when referenced, while LoadFromRandomAccessSource connects HTTP range readers and custom storage and progressive linearization probes identify the exact first-page and main-xref ranges needed before a complete download

Revision-aware loading now validates xref free lists and generation transitions while retaining bounded details for duplicate and shadowed object definitions; explicit clean, dirty, released, and must-write object states support low-memory post-save object-stream cache release, while deterministic dictionary order and QDF-style diagnostic output make structural inspection reproducible

Reusable layout elements support side-effect-free measurement, verified split heads, and owned overflow continuations for paragraphs, rows, containers, and custom content; declarative page callbacks compose backgrounds, headers, document content, footers, and foregrounds in stable order, while unbounded reports retain file-backed page staging, paragraph constraints, bounded diagnostics, semantic helpers, and bidi direction control

Loaded-page rendering executes coloured and uncoloured tiling patterns plus axial and radial shading patterns for fills and strokes, honours pattern matrices and path clipping, and bounds recursive pattern depth and tile execution for hostile resources

SanitiseLoadedDocument applies JavaScript-only, active-content, or strict untrusted-document policies to loaded PDFs, removes unreachable payload objects, compacts live object numbers, and safely rewrites in place through atomic file replacement

Preflight JSON, HTML, and veraPDF-style findings expose stable namespaced rule identifiers and structured PDF locations with logical scope, path, key, and exact object, page, or byte coordinates when available, while text and CSV compatibility remains unchanged

Reusable validation policies now combine structural preflight with strict or WTPDF intake requirements, extract canonical declaration and claim metadata, run ordered file batches through bounded worker and queue limits, preserve source-aware errors, and offer inspect, add-missing, and synchronize modes for XMP repair independently of structural PDF repair

Factur-X and ZUGFeRD intake now cross-checks the primary invoice attachment MIME type and FileSpec names against the EmbeddedFiles and Catalog AF registrations, exposes the decoded MIME type and XMP namespace URI, and rejects mismatched XMP document types or extension namespaces

PDF 2.0 output now supports PDF/A-4, PDF/A-4e, PDF/A-4f, and PDF/UA-2 identification, including revision-aware XMP, namespace-aware structure elements, strict namespace registration checks, PDF 2.0 structure roles, and associated-file authoring for the archival engineering and file-embedding profiles

The v2.119.32-51 cycle added producer-side Arabic / Persian / Urdu shaping (LAM-ALEF mandatory ligature, Arabic Presentation Forms-A 9 letters), a feature-complete OpenType GSUB substitution engine covering every LookupType 1-8 with Script / LangSys selection and TTF subsetter closure for substitute glyphs, XFA (XML Forms Architecture) container support (AddXFAPacket / ClearXFAPackets / XFAPacketCount), an AcroForm /AA /K + /F + /V + /C form-field trigger family, multi-Unicode /DR font registration via RegisterAcroFormFont, structure-element accessibility attribute setters (/Lang / /E / /T) with a Table 333 standard structure type enum and AddStructureElement typed overload, and marked-content sequence properties on BeginTaggedContent.

The v2.119.52-68 cycle closed the Phase 8 automatic shaping pipeline and broadened script coverage: Arabic Extended-A (including the U+0750-077F Arabic Supplement and U+08A0-08FF Arabic Extended-A) and Persian / Urdu Form-B were extended into the full U+0672-06D5 joining-class table plus 26 new Forms-A mappings, with post-pass folding for LAM-ALEF, YEH-HAMZA + vowel pairs (8 ligatures in U+FBEA-FBFB), the standalone Allah ligature (U+FDF2), and the 22-codepoint Bismillah phrase (U+FDFD). The new opt-in ShapingFeatures property + THPDFShapingFeature enum (sfArabicGSUB / sfStandardLigatures / sfContextualLigatures / sfContextualAlternates / sfIndicShaping) makes the producer emit GSUB-driven font-specific rlig / liga / clig / rclt substitutions automatically, with Latin Standard Ligatures (ff / fi / fl / ffi / ffl / ſt / st via U+FB00-FB06) and Devanagari Indic syllable reordering (Repha + pre-base I-matra) joining the same pipeline. New shaping capability methods for Syriac (GetSyriacJoiningClass / GetSyriacPosition), Mongolian (GetMongolianJoiningClass / GetMongolianPosition), and Devanagari (GetDevanagariCategory / ApplyDevanagariReorder) let callers drive non-Arabic complex scripts through the same GSUB engine. GetCodepointAdvance exposes the cached /W em-fraction for wrap calculations, and AssignSyntheticCodepointForGID / GetSyntheticCodepointForGID let producer emit any GSUB substitute GID (Devanagari cluster shapes, stylistic alternates, CJK variation sequences) through Private-Use-Area codepoints with full /CIDToGIDMap + /ToUnicode + /W integration. Cumulative ToUnicode CMap now ships 35 ligature reverse-mapping entries (8 LAM-ALEF + 18 YEH-HAMZA family + 1 Allah + 1 Bismillah + 7 Latin) so consumer-reader copy / paste produces the source codepoints. Documentation skeletons for ChangeLog now ship in 11 languages (EN / CN / AR / DE / ES / FR / IT / JA / KO / PT / RU) with a language-picker UI; ChangeLog retention limit was raised from 250 to 500 version sections.

The v2.152-v2.190 cycle built out a complete OpenType GPOS positioning engine and broadened complex-script coverage. Opt-in shaping options now apply the font's own kerning (pair, contextual, and right-to-left), combining-mark placement (mark-to-base, mark-to-mark, and per-component mark-to-ligature), cursive connection anchors, and vertical kerning for vertical text, all written as standard PDF text operators so any reader renders the same result. Producer-side shaping now covers Arabic (including the Supplement, Extended-A, and Extended-B blocks), Syriac, Mongolian, N'Ko, Adlam, Hanifi Rohingya, Tibetan consonant stacking, Devanagari and the other Indic scripts through the font's Indic feature chain, Javanese, Thai and Lao mark ordering, Hebrew vowel-point ordering, Khmer, Myanmar, Tai Viet, and Meetei Mayek. A family of optional OpenType typography features - standard, discretionary, and historical ligatures, small capitals, oldstyle / lining / proportional / tabular figures, superscripts, subscripts, ordinals, fractions, scientific inferiors, numerators, denominators, stylistic and contextual alternates, localized forms, case-sensitive forms, slashed zero, and vertical alternates - can be applied automatically during text output. Copy, paste, and text search recover the original characters across all shaped output, including ligatures and chained feature substitutions. Font output also became smaller: embedded font programs are always Flate-compressed, a font used on several pages is embedded once per document, subset tags are derived deterministically for reproducible output, and an optional compact mode writes plain-ASCII text with standard fonts as unembedded WinAnsi text.

PDF Standards Coverage

HotPDF includes version-specific support for the 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. Public APIs are checked against the selected PDF version so generated files avoid newer entries when strict compatibility is required.

The current matrix covers filters and predictors, XRef streams, incremental update chains, AES encryption, public-key security, Ed25519, Ed448, extension-gated ML-DSA verification, callback, remote, and PKCS#11 signing providers, DeviceCMYK and ICCBased color, tiling patterns, axial/radial/multi-stop shadings, inline images, layers, transparency groups, page transitions, annotations, AcroForm widgets, XMP metadata, tagged PDF structure trees, OutputIntents, production page boxes, ViewerPreferences, UserUnit, Tabs order, and font embedding/subsetting for TrueType, Type 3, CFF, OpenType-CFF, and CID-keyed CFF fonts.

This is broad standards-aware coverage for HotPDF's supported authoring surface, not a blanket claim that every edge case in ISO 32000-1 is implemented.

Why Choose HotPDF

Native RAD Studio Fit

Use familiar Delphi and C++Builder projects, packages, streams, forms, and drawing patterns instead of wrapping a separate PDF engine.

Modern PDF Features

Build PDFs with forms, annotations, layers, transparency, page transitions, tagged structure, encryption, signing placeholders, and incremental updates.

Compact, Fast Output

Reduce PDF size with zlib-ng compression, libjpeg-turbo imaging, TrueType subsetting, OpenType-CFF subsetting, and CID-keyed CFF support for large CJK fonts.

Competitive Strengths

The capabilities below are hard technical differentiators for HotPDF versus typical Delphi PDF components. Most competing commercial components either lack these features entirely or are materially weaker in production. Each row maps to a verifiable implementation and a public API surface inside the library.

Complete OpenType Shaping + Positioning

A full GSUB substitution engine covering every LookupType 1-8 (Single, Multiple, Alternate, Ligature, Contextual, Chained Contextual, Extension, Reverse Chained Contextual), paired with a GPOS positioning engine covering all 9 LookupTypes (pair / single / contextual kerning, mark-to-base, mark-to-mark, per-ligature-component mark-to-ligature, cursive attachment, distance, vertical vkrn/vpal). All positioning is emitted with standard PDF text operators, so every reader renders identically.

Producer-Side Complex Script Shaping

20+ scripts shaped on the producer side, driven by the font's own GSUB feature chain: Arabic (incl. Supplement / Extended-A / Extended-B), Syriac, Mongolian, N'Ko, Adlam, Hanifi Rohingya, Tibetan stacking, Devanagari and the Indic family, Javanese, Thai / Lao mark ordering, Hebrew vowel ordering, Khmer, Myanmar, Tai Viet, Meetei Mayek. Output carries full /ToUnicode reverse mapping so copy / paste recovers the original codepoints.

In-Process Signing Stack, Zero External Deps

ASN.1, RSA, AES, PBES2 PKCS#12 unwrapping, legacy PBE-SHA1-3DES PFX unwrapping, and CMS SignedData (RFC 5652) are handled inside HotPDF. SignPDFWithPFX signs a placeholder PDF in one call with no OpenSSL runtime or external native binaries; loaded-signature verification supports RSA PKCS#1 v1.5, parameter-validated RSA-PSS, ECDSA, RFC 3161 timestamp tokens, caller-controlled certificate paths, and offline OCSP or CRL validation

PAdES Long-Term Validation, End to End

PAdES B-B, B-T, B-LT, and B-LTA workflows are covered end to end with RFC 3161 signature and document timestamp verification, DSS / VRI certificate and revocation validation, caller-supplied trust anchors, Seed Value constraints, and XAdES-in-PDF

Three-Axis Compliance + Preflight

Independent profile gating for PDF/A-1/-2/-3, PDF/X-1a/-3/-4, and PDF/UA-1 simultaneously - non-conformant calls raise diagnostic exceptions instead of silently writing non-compliant PDFs. CreatePreflightReport emits text / JSON / HTML / CSV reports with stable rule IDs, structured finding locations, INI profiles, built-in presets, batch aggregation, and XMP evidence embedding, while reusable validation policies add WTPDF declarations, bounded concurrent intake, and independent metadata repair

Multi-Gigabyte Direct File API

Operates on the PDF on disk without building the in-memory object graph. On a 2 GB document with 1.67 million objects: AES-256 encryption ~14 s, decryption ~16 s, full rewrite ~6 s; reading the page count of a 1.25 GB document takes milliseconds. Classic xref tables, XRef streams, hybrid-reference files, and incrementally updated documents all stay on the direct path.

Bounded Damaged-PDF Recovery

Relocates intact xref tables or streams after a broken startxref, then falls back to a token-aware 1 MiB chunk scanner that rebuilds direct-object offsets with configurable byte and object budgets, newest-definition precedence, stream-body false-positive filtering, structured diagnostics, and mandatory full rewrite on save

CFF / OpenType-CFF / CID Subsetting

TrueType, OpenType-CFF, and CID-keyed CFF fonts are all subsettable while preserving glyph IDs for Type0 / Identity-H text. CJK documents that previously embedded 14 MB CID-keyed CFF programs now ship at 500 KB - 2 MB with no rendered glyphs lost; embedded font programs are always Flate-compressed, multi-page fonts embed once per document, and subset tags are deterministic for reproducible output.

Unified Runtime Logging Facade

THPDFLogger + the global HPDFLog give a runtime-toggleable diagnostic facade: Error / Warning / Info / Debug severity filtering, simultaneous file + OutputDebugString + console targets, thread-safe, 10 MB single-backup rollover, zero-overhead disabled fast-path. LoadFromFile, preflight reports, and the object-stream fallback path are already wired with structured diagnostics that can be toggled at runtime without rebuilding - an operational capability most competing components lack entirely.

Four Report-Engine Adapters

Drop-in PDF backends for FastReport (TfrxHotPDFExport), QuickReport (TQRHotPDFExportFilter), ReportBuilder (TppHotPDFDevice), and DevExpress ExpressPrinting (covering cxGrid / cxRichEdit / cxScheduler / cxPivotGrid). Existing report layouts keep working - only the PDF emitter is swapped, with FastReport native text / image / shape / line / link / barcode output including picture clipping and frames, FastReport design-time palette registration, one-based page range filtering, ReportBuilder native text / vector / image / link / barcode output, and opt-in PDF/A and PDF/X conformance gates across all four report adapters

These are delivered capabilities, not roadmap promises. Every item above is implemented in the current library, compiles cleanly, and passes DUnitX tests plus end-to-end veraPDF validation. When evaluating competing components, ask for proof of full GSUB/GPOS LookupType coverage, an in-process PAdES B-LTA chain, and measured multi-gigabyte encryption throughput.

Developer Advantages

  • Source-oriented integration keeps debugging and deployment under your control.
  • Shared Delphi and C++Builder examples make it easier to verify behavior in both language stacks.
  • Static third-party C library integration keeps compression and imaging dependencies reproducible.
  • Focused helper APIs cover PDF filters, bounded TIFF and PNG predictor reversal, strict LZW stream decoding, FlateDecode, CCITT, image masks, barcodes, font subsetting, and page content workflows
  • PDF version gates can automatically promote the output version or enforce strict PDF 1.3/1.4/1.5/1.6/1.7 conformance through StrictVersionLock.
  • Ready-to-use Delphi and C++Builder package projects cover current RAD Studio generations, including 13.1 Florence.

Recent Library Highlights

Multi-Gigabyte Direct File API

The DAOpenFileReadOnly / DACopyFile / DASetDocumentInfo / DASaveAsFile family and the file-to-file EncryptFile / DecryptFile calls work on the PDF file directly instead of building the in-memory object graph. On a 2 GB benchmark document with 1.67 million objects, AES-256 encryption takes about 14 seconds, decryption about 16 seconds, and a full rewrite about 6 seconds; opening a 1.25 GB document for its page count takes milliseconds. Classic tables, cross-reference streams, hybrid-reference files, and incrementally updated documents all stay on the direct path.

Preflight Reports

CreatePreflightReport and CreatePreflightReportWithProfile audit a PDF against the supported PDF/A, PDF/X, and PDF/UA checks and emit text, JSON, HTML, or CSV reports, with INI-style profiles to suppress accepted findings - ready for CI gates and batch document intake. The PreflightCLI demo adds recursive folder runs and aggregate dashboards.

Loaded-Document Form Toolkit

HasFormFields and FormFieldExists answer form questions about a loaded PDF before touching it, loaded field creation rejects duplicate root names before registering widgets, field values can be read and written by index or name, and FlattenFormFields burns interactive AcroForm fields into page content and reports how many fields it flattened - alongside XFA-to-AcroForm flattening that keeps nested, wrapped, fixed-column, and auto-column table XFA forms usable in any reader

In-Process PFX / PKCS#12 Signing

THotPDF.SignPDFWithPFX(InputPDF, OutputPDF, PFXFile, Password) signs an existing placeholder PDF in a single call. The ASN.1, RSA, AES, PBES2 PKCS#12, legacy PBE-SHA1-3DES PFX, and CMS SignedData (RFC 5652) stack is handled inside HotPDF with no OpenSSL runtime or external native binaries

PAdES Long-Term Validation

PAdES B-B, B-T, B-LT, and B-LTA workflows cover RFC 3161 timestamp creation and cryptographic verification, DSS / VRI long-term validation with offline OCSP and CRL evidence, caller-controlled certificate paths, document timestamp signatures, Seed Value constraints, and XAdES-in-PDF

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

HotPDF gates feature methods against PDF/A-1 / -2 / -3, PDF/X-1a / -3 / -4, and PDF/UA-1 profiles. Calls that would break the selected profile (transparency in PDF/A-1, JavaScript in PDF/A, external annotations in PDF/X, untagged structure in PDF/UA) raise diagnostic exceptions instead of silently producing non-conformant PDFs.

Third-Party Report Engine Adapters

Drop-in PDF backends for the four most common Delphi report engines: TfrxHotPDFExport (FastReport 4 / FastReport VCL, including native-object output for text, pictures, shapes, lines, links, and supported barcodes plus page range filtering, font embedding controls, password security, PDF/A or PDF/X gate opt-ins, and the frxHotPDFDesign design-time registration unit), TQRHotPDFExportFilter (QuickReport with PDF/A or PDF/X gate opt-ins), TppHotPDFDevice (ReportBuilder, including opt-in native draw-command output for text, vector primitives, images, links, supported barcodes, and PDF/A or PDF/X gate opt-ins), and dxHotPDFExportReportLinkToFile/Stream (DevExpress ExpressPrinting System covering cxGrid / cxRichEdit / cxScheduler / cxPivotGrid with PDF/A or PDF/X gate opt-ins). Existing reports keep working - only the PDF emitter is swapped

OpenType GPOS Positioning Engine

Opt-in text positioning driven by the font's own GPOS data: pair and contextual kerning for left-to-right and right-to-left text, mark-to-base, mark-to-mark, and per-ligature-component mark placement, cursive entry/exit alignment, distance positioning, and vertical kerning for vertical fonts. Positioning is emitted with standard PDF text operators, so every PDF reader renders the same result.

Complex Script Shaping Coverage

Producer-side shaping renders correctly joined and reordered text for Arabic (including the Supplement, Extended-A, and Extended-B blocks), Syriac, Mongolian, N'Ko, Adlam, Hanifi Rohingya, Tibetan, Devanagari and the other Indic scripts, Javanese, Thai, Lao, Hebrew, Khmer, Myanmar, Tai Viet, and Meetei Mayek without relying on a viewer-side shaper. Each script is an opt-in switch, so existing output stays byte-identical until enabled, and copy/paste recovers the original characters.

Automatic OpenType Typography Features

Optional shaping switches apply the font's standard, discretionary, and historical ligatures, small capitals, oldstyle / lining / proportional / tabular figures, superscripts, subscripts, ordinals, fractions, scientific inferiors, numerators, denominators, stylistic and contextual alternates, localized forms, case-sensitive forms, slashed zero, and vertical alternates automatically during text output, with text extraction mapped back to the source characters.

Compact Font Output

Embedded font programs are always Flate-compressed, a font used on several pages is embedded once for the whole document, and subset tags are derived deterministically from the glyphs actually used so repeated runs produce identical output. An optional mode writes plain-ASCII text with standard fonts as compact unembedded WinAnsi text, shrinking a page of plain text from hundreds of kilobytes to a few kilobytes.

Multi-Script Producer Shaping

Producer-side shaping folds Unicode-input runs into their Presentation Forms before PDF text emission. Arabic covers the full U+0672-06D5 joining-class table plus 40+ Forms-A mappings, with automatic ligature post-pass for LAM-ALEF, YEH-HAMZA + vowels (U+FBEA-FBFB), Allah (U+FDF2), and Bismillah (U+FDFD). Capability surfaces for Syriac (GetSyriacJoiningClass), Mongolian (GetMongolianJoiningClass), and Devanagari (GetDevanagariCategory / ApplyDevanagariReorder) let callers drive non-Arabic complex scripts through the same GSUB engine.

Automatic Shaping Pipeline (Phase 8)

The opt-in ShapingFeatures property + THPDFShapingFeature enum (sfArabicGSUB / sfCursiveAttachment / sfStandardLigatures / sfContextualLigatures / sfContextualAlternates / sfIndicShaping) elevates the OpenType GSUB and GPOS engines into an automatic producer-side pipeline. Native Arabic init / medi / fina / isol, rlig, calt, rclt, GPOS cursive attachment, Latin liga / clig, and Devanagari Indic reordering happen as text is emitted, with full /ToUnicode reverse-mapping for copy / paste correctness.

Latin Standard Ligatures + PUA Synthetic Codepoint

Latin Standard Ligatures (ff / fi / fl / ffi / ffl / ſt / st via U+FB00-FB06) are emitted automatically through ApplyLatinLigatureRefinement when sfStandardLigatures is enabled. For GSUB substitute GIDs without a natural Unicode codepoint - Devanagari cluster shapes, stylistic alternates, CJK ideographic variation sequences - AssignSyntheticCodepointForGID allocates a Private-Use-Area (U+E000-F8FF) codepoint with mirrored /CIDToGIDMap + /W + /ToUnicode integration.

OpenType GSUB Substitution Engine

Every OpenType GSUB LookupType 1-8 (Single, Multiple, Alternate, Ligature, Contextual, Chained Contextual, Extension, Reverse Chained Contextual) is implemented as a capability-only query surface (GetSingleSubstituteGlyph, ApplyLigatureSubstitution, ApplyContextualSubst, ApplyReverseChainedContextualSubst, and the Multiple / Alternate / Script / LangSys / Feature helpers). MarkUnicodeGlyphUsed pulls every substitute glyph into the TTF subsetter so embedded font subsets stay self-contained.

Page Actions + XFA Forms + AcroForm Triggers + Unicode /DR

PDF document lifecycle additional actions expose catalog /AA /WC, /AA /WS, /AA /DS, /AA /WP, and /AA /DP triggers through builder-based set and clear helpers, while page-level additional actions expose /AA /O open and /AA /C close triggers through THPDFPage and page-indexed THotPDF wrappers. PDF 1.7 §12.7.6 / §12.7.8 XFA container packets ride alongside (or instead of) static /Fields via AddXFAPacket. The full AcroForm form-field trigger family (/AA /K Keystroke, /F Format, /V Validate, /C Calculate) is exposed as wrapper methods, widget mouse, focus, and visibility triggers (/E, /X, /D, /U, /Fo, /Bl, /PO, /PC, /PV, /PI) can now be set by field name, and matching clear helpers keep trigger dictionaries easy to replace. THPDFActionBuilder spans document lifecycle, page, form, annotation, layer, multimedia, transition, 3D-view, and GoToE embedded-navigation actions, while the loaded action graph API safely inspects all 18 standard action types and ordered /Next chains

Page Labels + Article Threads

THotPDF.SetPageLabel and its style-specific helpers write catalog /PageLabels number-tree entries for decimal, roman, and alphabetic page numbering, while RegisterArticleThread plus THPDFPage.AddArticleBead emits article thread dictionaries and bead chains for guided reader navigation

Font Subsetting and CJK PDFs

THotPDF.EnableFontSubsetting subsets TrueType, OpenType-CFF, and CID-keyed CFF fonts while preserving glyph IDs for Type0 / Identity-H text. CJK PDFs that previously embedded 14 MB CID-keyed CFF programs now ship at 500 KB - 2 MB without losing any rendered glyphs.

Advanced PDF Feature Coverage

  • Version-specific PDF 1.3 / 1.4 / 1.5 / 1.6 / 1.7 + selected PDF 2.0 API gates for Catalog, ViewerPreferences, annotations, JavaScript, Type0 fonts, ToUnicode maps, transparency, layers, and encryption.
  • PDF/A-1 / -2 / -3, PDF/X-1a / -3 / -4, and PDF/UA-1 conformance gates that refuse non-conformant feature calls instead of silently violating the profile.
  • Tagged PDF structure trees with role maps, StructParents, ParentTree output, and structure elements for accessibility-oriented workflows.
  • OutputIntents, ICC profiles, page boxes, rotation, UserUnit, Tabs order, tiling patterns, ExtGState alpha, blend modes, halftones (Type 1 / 5 / 6 / 10 / 16), transfer functions, and black-generation / under-color-removal Function references.
  • Inline images, multi-stop axial gradients, radial gradients, free-form / lattice-form Gouraud-shaded triangle meshes, Coons patch and tensor product patch meshes, soft-mask images for PNG-style per-pixel alpha, and reusable pattern fills.
  • Named destinations, page thumbnails, page-level outline styling (color, bold, italic), document-level named JavaScript registry, and the full Line / PolyLine / Polygon extras family (caption, line endings, intent, border effect).
  • Producer-side Arabic shaping covers the full U+0672-06D5 joining-class table plus 40+ static Arabic Presentation Forms-A mappings, with post-pass ligature folding for LAM-ALEF, YEH-HAMZA + vowel pairs (U+FBEA-FBFB), the Allah ligature (U+FDF2), and the Bismillah phrase (U+FDFD).
  • Multi-script shaping capability surfaces: Syriac (GetSyriacJoiningClass / GetSyriacPosition), Mongolian (GetMongolianJoiningClass / GetMongolianPosition), Devanagari (GetDevanagariCategory / ApplyDevanagariReorder) - drive the same GSUB engine for complex non-Arabic scripts.
  • Automatic Phase 8 shaping pipeline driven by the ShapingFeatures opt-in property: sfArabicGSUB applies native Arabic init / medi / fina / isol plus rlig / calt / rclt to emit font-specific contextual glyph IDs, sfCursiveAttachment applies GPOS cursive anchors, sfStandardLigatures / sfContextualLigatures emit Latin liga / clig (FB00-FB06: ff / fi / fl / ffi / ffl / ſt / st), and sfIndicShaping reorders Devanagari clusters (Repha + pre-base I-matra) before emission.
  • Feature-complete OpenType GSUB substitution engine (LookupType 1-8) with Script / LangSys selection, TTF subsetter closure (MarkUnicodeGlyphUsed), Cmap format 12 SMP coverage, GDEF parsing, ToUnicode CMap auto-emission with 35 ligature reverse-mapping entries, and a GetUnicodeGlyphForCodepoint lookup for callers driving emission glyph-by-glyph.
  • PUA synthetic codepoint emit (AssignSyntheticCodepointForGID / GetSyntheticCodepointForGID) lets producers emit any GSUB substitute GID (Devanagari cluster shapes, stylistic alternates, CJK ideographic variation sequences) through U+E000-F8FF Private Use Area with mirrored /CIDToGIDMap + /W integration. GetCodepointAdvance exposes the cached /W em-fraction for wrap calculations.
  • OpenType GPOS positioning engine behind opt-in shaping switches: pair, single, and contextual (Context / Chained Context) kerning for both left-to-right and right-to-left text, mark-to-base / mark-to-mark / mark-to-ligature placement with per-component accuracy on ligatures, cursive entry-exit attachment, distance positioning, and vkrn / vpal vertical kerning applied to vertical text output.
  • Producer-side complex-script shaping for Arabic Supplement / Extended-A / Extended-B, Syriac, Mongolian, N'Ko, Adlam, Hanifi Rohingya, Tibetan stacking, the Indic script family through the font's Indic feature chain, Javanese, Thai / Lao mark ordering, Hebrew vowel-point ordering, Khmer, Myanmar, Tai Viet, and Meetei Mayek, each behind its own opt-in switch with ToUnicode reverse mapping for copy / paste.
  • Automatic OpenType typography features during text output: liga / clig / dlig / hlig ligatures, smcp / c2sc small capitals, onum / lnum / pnum / tnum figure styles, sups / subs / ordn / frac / sinf / numr / dnom, salt stylistic alternates, calt / rclt contextual alternates, locl localized forms, case forms, zero slashed zero, and vert / vrt2 vertical alternates, with chained substitutions resolved back to the source text in the ToUnicode CMap.
  • Font embedding optimization: always-compressed embedded font programs, one embedded copy per document for fonts used on several pages, deterministic subset tags for reproducible output, and an optional unembedded WinAnsi mode for plain-ASCII text with standard fonts.
  • AcroForm text fields, list boxes, combo boxes, check boxes, radio buttons, push-button actions (including extended Named / Hide / Show / ImportData / SubmitForm with user-controlled /Flags and THPDFActionBuilder advanced action chains), signature fields, and generated appearance streams (multi-line + comb + rich-text Tx + CID-font /AP)
  • AcroForm form-field trigger family (/AA /K Keystroke, /F Format, /V Validate, /C Calculate) with one wrapper method per JavaScript trigger, named THPDFActionBuilder set and clear helpers, field-name wrappers for widget mouse and focus triggers (/E, /X, /D, /U, /Fo, /Bl), multi-Unicode /DR font registration via RegisterAcroFormFont, XFA (XML Forms Architecture) container support (PDF 1.7 §12.7.6 / §12.7.8) with AddXFAPacket / ClearXFAPackets / XFAPacketCount and PDF/A + PDF/X compliance gates, plus XFA-to-AcroForm flattening (ApplyXFAAsAcroForm for raw XDP bytes, FlattenLoadedXFA for a loaded PDF's embedded form) that turns static XFA into native AcroForm fields, styling, flow-measured nested layout="tb", wrapped layout="lr-tb", fixed-column and auto-column table-row text fields, and page graphics so the form stays visible and fillable in readers without an XFA engine
  • Generated-document navigation metadata: catalog /PageLabels ranges through THPDFPageLabelStyle, SetPageLabel, and the decimal / roman / alphabetic helper methods, plus catalog /Threads and per-page article beads through RegisterArticleThread and THPDFPage.AddArticleBead
  • Catalog document lifecycle /AA /WC, /AA /WS, /AA /DS, /AA /WP, and /AA /DP additional actions through THotPDF helpers, plus page-level /AA /O and /AA /C additional actions through THPDFPage.SetPageAdditionalAction and THotPDF.SetPageAdditionalAction, including THPDFActionBuilder /Next chains and clear helpers
  • PDF/UA-1 tagged-PDF accessibility surface: §14.8.4 marked-content sequence properties on BeginTaggedContent (/Lang / /Alt / /ActualText / /E), structure-element attribute setters (/Lang / /E / /T), Table 333 standard structure-type enum (THPDFStandardStructureType) plus an AddStructureElement typed overload.
  • Annotation support for highlights, free text, links, file attachments, popups, redaction, watermark, rich media, 3D / U3D / PRC, border styles, and linked comment popups.
  • Standard password security, AES-128 / AES-256 security handlers, PDF 2.0 R6 hashing, certificate-recipient public-key encryption through caller-supplied PKCS#7 envelopes, and binary-safe handling of non-ASCII colorant / font names.
  • PAdES B-B, B-T, B-LT, and B-LTA digital signatures with RFC 3161 timestamp verification, DSS / VRI certificate and revocation validation, caller-supplied trust anchors, Seed Value constraints, and XAdES-in-PDF
  • In-process PFX / PKCS#12 signing: the library-bundled ASN.1, RSA, AES, PBES2 PKCS#12, legacy PBE-SHA1-3DES PFX, and CMS SignedData stack signs an existing placeholder PDF in one call without any OpenSSL runtime or external native binaries
  • Drop-in PDF backends for FastReport 4 / FastReport VCL, QuickReport, ReportBuilder, and DevExpress ExpressPrinting System, plus a VCL TDBGrid table exporter with PDF/A and PDF/X gate opt-ins

High-Performance Compression and Imaging Stack

Current HotPDF builds use zlib-ng in zlib-compatible mode for the bundled Flate backend. Page streams, embedded font streams, ToUnicode CMaps, Flate image streams, TIFF-related output, and FlateDecode helpers are routed through the HotPDF zlib layer.

The Win64x and diagnostic MSVC Win64 zlib-ng builds include runtime CPU dispatch for SSE2, SSSE3, SSE4.1, SSE4.2, PCLMULQDQ, and AVX2 paths with generic fallbacks retained. Win32 remains on the generic zlib-ng OMF object set through bcc32c, while Win32 JPEG and TIFF objects continue to use the classic bcc32 OMF path.

Standard JPEG workflows use the bundled libjpeg-turbo 3.1.90 object set through the libjpeg-compatible API exposed by HPDFJpeg.pas. The Win32, Win64, and Win64x native builds now include the relevant NASM SIMD object sets, and the same native JPEG backend is available to the TIFF integration layer for JPEG-compressed TIFF handling.

The C runtime bridge in HPDFCLibs.pas now resolves malloc, free, realloc, calloc, memcpy, memmove, and memset through one Pascal-facing layer, with 32-byte aligned allocation for SIMD-friendly native buffers.

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

Quick Delphi Example

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.

Package Contents

Typical Use Cases