THotPDF Class

THotPDF

Methods         Properties      Overview

Top  Previous  Next

THotPDF is the main class used to create and manage PDF documents.

 

Unit

HPDFDoc

 

Description

Use THotPDF to generate PDF documents from your application. Document generation starts with a call to BeginDoc. Drawing and text output are performed through the CurrentPage property, and you can create additional pages with the AddPage method. The PDF remains open until the application calls EndDoc.

 

Use THotPDF properties to configure metadata, output options, compression, security, and viewer behavior. For example, PDF encryption and permissions are controlled by the ActivateProtection property.

 

Using example:

 

uses

  ...

  HPDFDoc,

  ...

 

type

   ...

   HPDF: THotPDF;

   ...

 

procedure TForm1.HelloWorldButtonClick(Sender: TObject);

begin

   HPDF.AutoLaunch := true;                                          // Show the PDF after it is created

   HPDF.FileName := '.\HelloWorld.pdf';

   HPDF.BeginDoc;                                                       // Start PDF generation

   HPDF.CurrentPage.TextOut(10, 10, 0, 'Hello World!');  // Write text on the first page

   HPDF.EndDoc;                                                         // Finalize and save the PDF

end;