Table of Contents

PDF Library guides

TMS FNC Core includes TTMSFNCPDFLib, a cross-platform PDF library that creates documents, pages, and page content — HTML-formatted text, plain text, drawing primitives, images, form fields, and more — and that opens existing PDF documents to restructure and annotate them. The code is shareable between VCL, FMX, and WEB Core.

Add the appropriate unit to your uses clause:

uses
  FMX.TMSFNCPDFLib;   // FMX
  VCL.TMSFNCPDFLib;   // VCL
  WEBLib.TMSFNCPDFLib; // WEB Core

Key class: TTMSFNCPDFLib

A worked example: a one-page report

Most real documents are the same handful of operations arranged over a page, so it is worth seeing the destination before the chapters take it apart. The report below is a single generated PDF, and every element in it comes from one of the chapters:

A generated one-page PDF report with a coloured header band, an HTML-formatted intro paragraph, a banded table with right-aligned currency, a totals row and a footer

Element Chapter
The page itself, sized to its content, with the footer rule Creating a PDF document
The header band, the ruled and banded table rows Drawing graphics
The headings, the bold/coloured intro, the right-aligned currency Text and fonts

Read in that order, the four steps are: begin a document and give it a page → draw the shapes → draw the text over them → end the document. Everything else in these guides is a variation on that skeleton.

Chapters

Chapter Covers
Creating a PDF document The document skeleton, pages, page size, metadata, headers and footers, page numbering, security, archival format, generation callbacks, and unit conversion.
Drawing graphics Lines, rectangles, custom paths, path modes, clipping, gradients, transforms, images, and the FNC graphics engine.
Text and fonts Plain and wrapped text, multi-column flow, Mini HTML, alignment, line break modes, and font embedding.
Interactive form fields Text edits, check boxes, radio groups, combo and list boxes in a fillable PDF.
Printing Sending FNC graphics output to the system print spooler.
TMS WEB Core Font caching and compression when generating in the browser.

Choosing an approach

Three components sit under the PDF Library, and picking the wrong one costs the most time at the start:

You want to Use
Build a document from scratch, element by element TTMSFNCPDFLib — these guides
Export a control or canvas you already draw TTMSFNCGraphicsPDFIO
Send that same content to a printer instead TTMSFNCGraphicsPrintIO, see Printing
Reuse existing FNC paint code inside a TTMSFNCPDFLib document TTMSFNCGraphicsPDFEngine, see Drawing graphics

See also