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.

 

Cryptographic operations explicitly overwrite owned password copies, derived file and object keys, cached AES schedules, decrypted PKCS#12 private-key data, and streamed plaintext scratch when an operation succeeds, fails, or the component is destroyed

 

Copy-on-write object graph transactions provide nested savepoints that snapshot only touched indirect roots, spill large stream history to temporary storage, and restore root objects in place

 

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;