Table of Contents

Getting started with TMS FNC PDF Library

Prerequisites

  • TMS FNC Core installed and the runtime package added to the project.

Generate a simple PDF

var
  PDF: TTMSFNCPDFLib;
begin
  PDF := TTMSFNCPDFLib.Create(nil);
  try
    PDF.BeginDocument;
    PDF.NewPage;
    PDF.SetFont('Arial', [], 14);
    PDF.DrawText('Hello, TMS FNC PDF Library!', 40, 40);
    PDF.EndDocument;
    PDF.SaveToFile('output.pdf');
  finally
    PDF.Free;
  end;
end;

Drop on a form

  1. Drop TTMSFNCPDFLib from the TMS FNC UI palette page onto a form or data module.
  2. Call BeginDocument / NewPage / DrawText / EndDocument / SaveToFile in a button handler.

Export graphics canvas to PDF

GraphicsPDFIO1.Graphics := MyCustomControl.Graphics;
GraphicsPDFIO1.SaveToFile('export.pdf');
GraphicsPrintIO1.Graphics := MyCustomControl.Graphics;
GraphicsPrintIO1.Print;

Next steps