PDF Library for Delphi Docs

Native Pascal · Delphi · C++Builder · Free Pascal / Lazarus

A complete PDF engine that compiles into your own executable

PDF Library for Delphi is losLab's own PDF toolkit, written in Pascal and delivered as source. It is not a wrapper around a third-party PDF engine: you build it straight into your Delphi, C++Builder or Lazarus project, ship a single EXE, and step through every line in the debugger. The few C codecs it uses are linked as static object files, so the common path needs no extra DLL and no external PDF service

2 GBsingle documents with 1.67 million objects, encrypted and rewritten without loading the whole file
3,900+reference pages, each with Delphi, ActiveX and DLL syntax
3 editionsone API; each edition includes everything in the tier below
16documentation languages

What you get

Every point below is a shipped capability you can look up in the reference. Edition requirements are noted where a feature is not part of the Single edition

Native source, single-EXE deployment

The library compiles into your application like any other unit. There is no runtime fee, no service to install and no third-party PDF engine underneath, so a bug report ends in code you can read rather than in a black box

Static zlib-ng and libjpeg-turbo objects, no codec DLL on the common path

Huge files, small memory

Objects load on demand and offsets are 64-bit, so documents well past the old 2 GB string limit open normally. The Direct Access functions encrypt, decrypt, extract and rewrite file to file through a sliding read window instead of building the full object graph

2 GB / 1.67M objects: encrypt ≈ 32 s, decrypt ≈ 23 s, full rewrite ≈ 11 s

Encryption from RC4 to PDF 2.0

40/128-bit RC4, AES-128 and AES-256, plus AES-256-GCM authenticated encryption (ISO/TS 32003), SM4, and an optional PDF MAC integrity token. AES uses AES-NI when the CPU has it and falls back to software with byte-identical output

EncryptFile · SetPDFMACEnabled

Signatures from basic to PAdES B-LTA

Sign with a PFX file, a system certificate or an external digest, and inspect existing signatures, in every edition. Small Business adds revision and post-signature change analysis. Enterprise adds trusted validation, RFC 3161 timestamps, PAdES B-T to B-LTA with DSS/VRI, OCSP/CRL retrieval, PKCS#11 tokens, CSC cloud signing and EU Trusted Lists

Security and Signatures

E-invoicing built in

Generate Factur-X / ZUGFeRD / XRechnung and UBL invoices, embed the XML in a PDF/A-3 container, extract it again and check the container, all in the Single edition. Small Business adds EN 16931 business-rule validation with built-in or packaged rule sets

ValidateFacturXInvoice · ValidateInvoiceBusinessRules (Small Business)

Standards-aware output

Author PDF/A, PDF/UA, tagged PDF, PDF/X, PDF/E, PDF/R, PDF/VT and PDF/VCR, and lock the save version so a file never exceeds the PDF level you promised. Enterprise adds PDF/A conversion, PDF/A, PDF/UA-1 and Arlington preflight, and reports in text, JSON, HTML or CSV that CI can compare against a baseline

ConvertToPDFX · Preflight reports (Enterprise)

Get the text out

Extract text as plain strings or as positioned text blocks with font and color data, make scanned pages searchable with the built-in OCR engine or Tesseract, and export pages as semantic HTML or Markdown that is ready for search indexes, knowledge bases and language-model pipelines

OCRDocument · ExportDocumentMarkdown

Rendering and printing

Render pages to a device context, memory, a stream, a metafile or an image file with the built-in GDI+ renderer, or switch to the optional Cairo or PDFium backends. A capability report tells deployment scripts which renderer each operation will use before anything runs

GetRenderCapabilities · PDFium · Cairo

One API, many hosts

Use the VCL classes from Delphi (Win32, Win64) and C++Builder, build the same sources with Free Pascal / Lazarus for Win32, Win64 and Windows on Arm, or call the identical function set from C, C#, VB.NET or VC++ through the DLL and ActiveX control. A macOS Dylib covers Intel and Apple Silicon

Delphi, ActiveX and DLL syntax on every reference page

Where it fits best

High-volume and server-side pipelines

Batch encryption, decryption, splitting and extraction of very large documents without holding them in memory

Desktop software that ships as one file

Applications that must carry no third-party PDF DLL and need the whole PDF path debuggable at source level

Invoicing and business documents

Factur-X / ZUGFeRD / XRechnung output, plus document comparison, visual review PDFs, Bates numbering, data merge and batch conversion in the Small Business edition

Signatures and long-term archiving

PAdES B-LTA, timestamps, revocation evidence, hardware tokens, cloud signing, secure redaction and signed audit evidence in the Enterprise edition

Typesetting and reports

Standard 14, TrueType, OpenType, Type 1 and CJK fonts with bundled CMaps, kerning, HTML and Markdown text, tables, barcodes, forms and vector graphics

Mixed-language products

One PDF feature set shared by Delphi, C++Builder, Lazarus, .NET, C/C++ and macOS components of the same product

Editions at a glance

Each edition includes everything in the tier below. The edition comparison lists every feature ID and its published limits

Edition Class (unit) Adds Demos and CLI
Single TPDFlib (PDFlibrary) Creation, editing, rendering, printing, viewing (TPDFlibViewer), text extraction, OCR, HTML and Markdown export, forms, standard barcodes, basic signing and signature inspection, password encryption and public-key decryption, large-file Direct Access, PDF/A, PDF/UA and PDF/X/E/R/VT/VCR authoring, Factur-X / ZUGFeRD and UBL generation 16 core demos, including Showcase and the domain labs
Small Business TPDFlibSmallBusiness (PDFlibSmallBusiness) Document comparison and visual review PDFs, revision and post-signature modification analysis, invoice business-rule validation, Bates numbering, PDF/VCR data merge, optional-content flattening, batch conversion presets, professional barcodes (rMQR, GS1 DataBar, MaxiCode) SmallBusinessLab; WorkflowCLI visual, batch, cancel-batch
Enterprise TPDFlibEnterprise (PDFlibEnterprise) PDF/A conversion, PDF/A, PDF/UA-1 and Arlington preflight with structured reports, secure redaction, public-key encryption, trusted signature validation, timestamps, PAdES B-LT/B-LTA, PKCS#11 and CSC cloud signing, EU Trusted Lists, signed audit evidence EnterpriseLab; WorkflowCLI audit, sign, verify

Encrypt a multi-gigabyte file in a few lines

The source file is streamed to the output; it is never loaded into memory as a whole:

uses PDFlibrary;

var
  PDFlib: TPDFlib;
  Permissions: Integer;
begin
  PDFlib := TPDFlib.Create;
  try
    // Allow printing, copying and form filling; block editing and assembly
    Permissions := PDFlib.EncodePermissions(1, 1, 0, 0, 1, 1, 0, 1);
    // Strength 4 = AES-256 (Acrobat X and later)
    if PDFlib.EncryptFile('big-input.pdf', 'big-encrypted.pdf',
                          'owner-password', '', 4, Permissions) = 0 then
      Writeln('Encryption failed, LastErrorCode = ', PDFlib.LastErrorCode);
  finally
    PDFlib.Free;
  end;
end;

Straight answers

  • PDF/A, PDF/UA and Arlington checks run declared, machine-checkable rules and report what they could not check; they help you reach conformance but are not a certification
  • OCR, Cairo, PDFium, professional barcodes and cloud signing depend on runtime data, libraries or credentials you configure; capability reports tell you what is available before you call an operation
  • Automatic tagging gives a starting structure; reading order and accessibility still need human review

Next steps

Install the package with Getting Started, pick an edition in the edition comparison, then explore Document Manipulation, Direct Access and Security and Signatures, or read the release notes