Free Pascal and Lazarus
Build Win64 applications with Free Pascal 3.2.2 and Lazarus 4.6 through Lib/FPC/HotPDFLaz.lpk or the reproducible build-Win64-Lib-FPC.cmd script
Document creation and loading are supported with Flate compression and AES encryption; the TIFF, JPEG 2000, JBIG2, color-management and Zopfli codecs are not linked in Free Pascal builds and report a failure when requested
The whole library compiles under Free Pascal, including XFA form flattening, the XPS, EPUB and CBZ document handlers, the viewer components and HTML import
Why Choose HotPDF
Eight hard-to-match differentiators, the supporting evidence, and the audiences HotPDF is built for — on one page: native source with no DLL, full OpenType shaping, in-process PFX signing, PAdES, three-axis compliance, the multi-gigabyte Direct File API and more
See the core selling points
Capability Map
One list of what HotPDF covers: forms, annotations, security and signatures, standards, layers, graphics, images, text, large files and stream output
HotPDF overview
Core Component
Create documents, configure output, manage metadata, protect files, and finalize generated PDFs
THotPDF class
Advanced Workflows
Review loaded-document resolution, direct-file handling, xref-stream parsing, conformance output, and shaping helper workflows
Advanced workflow methods
Loaded Document Toolkit
Edit, merge, inspect, compare, sign, search, print, display, and recover existing PDFs through loaded-document APIs with structural object-graph diffs, aligned page changes, perceptual rendered metrics and heatmaps, multi-widget form editing, complete annotation editing, automatic bare-link activation, and cache-aware VCL viewing
Loaded document toolkit · Document comparison
Advanced AcroForm Processing
Evaluate bounded typed calculation and validation expressions with conditional, string, date, and array operations, regenerate variable-text appearances, resolve annotation states, and flatten selected fields under signature policies
Advanced AcroForm processing · Relationship cache
Bounded JavaScript Runtime
Run application-controlled JavaScript through static or bridge-DLL QuickJS deployments on Win32 and Win64 with strict resource budgets and stable diagnostics
QuickJS runtime deployment and API
Interactive Document Processing
Inspect and sanitize RichMedia assets, run dynamic XFA widgets without flattening, query and edit lossless XFA packet DOMs, evaluate bounded form scripts, and round-trip every supported XFDF annotation subtype
Interactive document processing · Interactive XFA runtime · XFA packet DOM · XFA form scripting
E-Invoice Business Rules
Validate Factur-X and ZUGFeRD containers plus every profile-specific Schematron check with reviewed XPath 2 compatibility and fail-closed diagnostics
E-invoice business-rule validation
Signing, Accessibility, and Portfolios
Validate signatures and evidence, deeply inspect and transactionally normalize safe PDF/A-4 structures, validate actual painted color, overprint and transparency for PDF/X-6 with versioned rules and bounded content work, generate PDF/UA structure from layout trees, diagnose document, annotation, form, navigation, and tagged semantics for PDF/UA-2, export shared machine-readable compliance findings, and build metadata-rich PDF Portfolios
CMS validation reports · PDF/A-4 validation · PDF/A-4 validation options · PDF/A-4 repair · PDF/A-4 repair options · PDF/X-6 validation · PDF/X-6 validation options · PDF/UA-2 validation and repair · PDF/UA-2 validation options · Automatic layout structure · Compliance findings JSON · PDF Portfolio collections
Font Fallback and Vertical Text
Resolve Unicode scalars through script-specific font chains, inspect actionable missing-glyph diagnostics, and emit CJK text with Identity-V and OpenType vertical metrics
Font fallback and vertical text
Variable and Color OpenType Fonts
Inspect axes, instantiate and subset CFF2 variation outlines and metrics, and render supported color-glyph formats
Variable and color OpenType fonts
Advanced Text and Streaming Layout
Compose Unicode paragraphs with language-aware breaking and bounded shaping caches, then build styled document sections, reusable components, lists, images, tables, bounded page continuations, and automatic logical structure
Advanced text and streaming layout · Layout visual diagnostics · Declarative layout DOM · Native vector charts · Automatic PDF/UA structure
Progressive Rendering and Cancellation
Render large loaded pages in bounded slices, publish progressive JPEG scans for earlier previews, cancel long operations through one caller-owned token, and record or replay external decisions for repeatable diagnosis
Progressive rendering and cancellation · Deterministic replay
Searchable OCR Text Layers
Connect any synchronous OCR engine to bounded high-resolution page rendering, validate word geometry and Unicode, align invisible text across rotated scans, and publish all selected pages atomically
Searchable OCR text layers
Loaded-Page Barcode Decoding
Decode full loaded pages or bounded PDF-space regions through application-selected engines, fall back across quarter turns, and receive validated payloads, confidence, orientation, and page-space bounds
Loaded-page barcode decoding
Review-First Redaction Detection
Detect bounded PII, named entities, and faces as confidence-scored page-space findings, require explicit reviewer identity before atomic annotation staging, and keep burn-in as a separate decision
Review-first redaction detection
Loaded-Page Color Rewrite
Convert selected pages to Gray, RGB, or CMYK, preserve ordinary text and paths as vectors, flatten complex color-managed paint losslessly, and make every spot-plate decision explicit
Loaded-page color rewrite
Structured Loaded-Page Export
Export one accessible reading model as HTML, XHTML, XML, or JSON with tagged order, navigation, page labels, annotations, forms, tables, styles, coordinates, and bounded embedded images
Structured loaded-page export · Loaded page-label text
Typed Table Extraction
Merge table fragments across pages, retain repeated headers and merged-cell spans, infer typed values with confidence, and export bounded CSV or JSON
Typed table extraction
Optional Document Handlers
Recognize XPS, EPUB, and CBZ by inspected content, preserve native XPS paths, gradients, cached package ImageBrush fills, Path opacity masks, isolated Canvas transparency groups and Canvas opacity masks, reusable VisualBrush Forms and patterns, transformed Canvas clips, package fonts, exact glyph IDs, clusters, advances, offsets, RTL origins, Unicode extraction, inherited Canvas navigation with descendant overrides, and clipped external or package-relative links, convert through shared archive and resource budgets, and reuse one immutable PDF cache for output and rendering
Optional document handlers
Rendering Diagnostics and Telemetry
Cache rendered pages by effective viewer state, report unsupported content, and inspect wall time, CPU, allocations, memory, I/O, cache activity, and decode expansion
Rendering diagnostics and telemetry
Pluggable Render Backends
Run compiled display lists through native or custom rendering engines with explicit capabilities, deterministic fallback, bounded parallel dispatch, and observable execution statistics
Pluggable render backends
Advanced Rendering Semantics
Render isolated and knockout transparency groups, luminosity soft masks, complete Type 3 glyph procedures, reduced-DCT JPEG targets, immutable zero-copy decoded-image handles, and budget-aware parallel JPEG 2000 regions
Advanced rendering semantics · Reduced-DCT JPEG decoding · Parallel image decode caching · Crash-isolated codec workers
Bounded JBIG2 Segment Graphs
Validate image and global segment dependencies, page associations, dictionary symbol counts, and allocation budgets before native or external decoding
JBIG2 segment-graph validation
Display Lists and Print Production
Reuse operator-indexed compiled page commands through one production interpreter, stream tiles and bands, render pages in parallel, flatten transparency without discarding spot colors, inspect ink and trapping, and produce process or spot plates
Display lists and print production
Resource and Image Optimization
Share repeated content, subset loaded fonts by glyph reachability, remove unused resources, preserve calibrated and spot-color semantics during image optimization, and pack indirect objects under explicit size and locality budgets
Resource and image optimization · Loaded-font subsetting
Object Graph Editing and Page Assembly
Round-trip versioned object graph snapshots and incremental updates, patch stable graphs, inspect dependency paths and retained-memory dominators, validate linearization, request reproducible output, assemble bounded source sets, compose page ranges, flatten rotation, and manage thumbnails
Object graph editing and page assembly · Versioned JSON round trips
Copy-on-Write Graph Transactions
Wrap object graph edits in nested savepoints, snapshot only touched indirect roots, spill large stream history to temporary storage, and inspect memory costs
Copy-on-write object graph transactions
Forms, Containers, and Integration Surfaces
Edit forms transactionally, validate attachments, organize Portfolios, integrate through a versioned zero-copy C ABI, compare named engines through deterministic probes, and continuously minimize malformed-PDF corpus cases
Forms, containers, and integration surfaces · Stable C callback ABI · Differential probes · Corpus minimization
Cross-Reference Recovery
Validate free lists, generation transitions, duplicate definitions, and shadowed revision offsets, then relocate or rebuild damaged xref data under bounded limits with byte-ranged confidence events
Cross-reference recovery
Editable Diagnostic Documents
Hand-edit deterministic QDF diagnostic objects or uncompressed streams, then measure stream payloads, rebuild classic xref rows and trailers, reject unsafe structure, and publish only a strictly reloadable PDF
Editable diagnostic documents and repair
Linearized Output
Write dependency-ordered PDFs with first-page and shared-object hint tables for fast display over byte-range transports
Linearized output and fast web view
Bounded Stream Processing
Decode strict built-in or application-defined push and pull filters through shared budgets and memory-to-disk spill buffers, isolate custom failures, select high-ratio Flate output through a deterministic zlib baseline and budgeted Zopfli block splitting, run bounded parallel image jobs, and rewrite only when output shrinks
Stream extraction, optimization, budgets, and diagnostics · Custom stream filter registry
Lossless Content Editing
Parse every content-stream byte into compact lexemes and linked syntax nodes, apply non-overlapping overlays, and serialize untouched ranges without normalization
Token-preserving content-stream AST · Content operator visitors
Scalable Random-Access Loading
Read source-file windows, scan simple objects through immutable spans, bound hostile tokens and containers, retain large page trees as compact placeholders, expose linearized first-page readiness from disjoint HTTP ranges, resolve page objects through indexed random access, and reload decoded object streams through a byte-capped LRU cache
Scalable and random-access loading · Span-based simple-object parsing · Bounded parser budgets · Lazy page-tree loading · Released page object graphs · Bounded object-stream cache
Statistical Performance Regression Gates
Benchmark native Win32 and Win64 load, save, render, and extraction workloads with warmup, raw samples, tail latency, RSS, process I/O, deterministic fixtures, and machine-readable thresholds
Statistical performance regression harness
Cache Infrastructure
Use bounded weighted object caching, streaming SHA-256 keys, persistent font-subset reuse, and a recoverable rendered-page cache with immediate LRU limit enforcement
Cache infrastructure
Signature Permissions
Verify RSA, RSA-PSS, NIST and Brainpool ECDSA, Ed25519, Ed448, extension-gated ML-DSA, and RFC 3161 signatures, sign directly from RSA, ECDSA, Ed25519, or Ed448 PFX identities, create deterministic CMS containers with independent primary signers, generate and pin PAdES E-EPES signature policies, preflight cumulative PAdES profiles with clause, object, and revision evidence, use callback, CSC remote, Windows CNG, or PKCS#11 signing providers, auto-size CMS placeholders without irreversible estimator calls, and inspect DocMDP and FieldMDP structures
Modern signature providers and permissions · Brainpool ECDSA signatures · PAdES signature-policy validation · PAdES profile preflight · CMS multiple primary signers · CSC remote signing · CMS placeholder auto-sizing
ICC Color Management
Validate and register ICC v2/v4 profiles, render ICCBased vector and image colors through proof and output profiles, honor all PDF rendering intents, apply black-point compensation, and reuse complete transforms through a bounded concurrent cache
RegisterICCProfile
Capability Map
Explore the HotPDF overview for forms, annotations, secure signatures, conformance, layers, graphics, images, text, large files, and stream output capabilities
HotPDF Overview
Page Drawing
Draw text, paths, curves, images, metafiles, annotations, and barcode output on the active page
THPDFPage class
Barcode APIs
Review THPDFBarcode, barcode option enums, simple bar records, and Simple* encoder functions
HPDFBarcode unit reference
Images
Review supported bitmap, TIFF, JPEG2000, JBIG2, EMF, and WMF workflows
Supported image formats
Compression
Understand FlateDecode, LZW, JBIG2, JPEG, JPEG2000, and bundled native compression paths
Compression overview
Preflight
Generate deterministic XML MRR, extend validation with bounded feature and rule plugins, apply profiles, aggregate batch runs, and review diagnostics
Preflight plugins and XML MRR
Validation Policies and WTPDF
Apply reusable intake policies, read WTPDF declarations, run bounded validation jobs, and repair metadata independently
Validation policies and WTPDF
Viewer Preferences
Control initial display, print preferences, single-page, column, and two-page cover-spread layouts, page mode, and related PDF viewer settings
ViewerPreferences reference
Pascal Examples
Open runnable examples for document creation, drawing, encryption, font embedding, paragraphs, and outlines
Example topics