THotPDF Class

THotPDF

เมธอด         คุณสมบัติ      ภาพรวม

ด้านบน  ก่อนหน้า  ถัดไป

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

 

Unit

HPDFDoc

 

คำอธิบาย

ใช้ THotPDF เพื่อสร้างเอกสาร PDF จาก application ของคุณ การสร้างเอกสารเริ่มด้วย call BeginDoc การวาดและ output ข้อความทำผ่าน property CurrentPage และคุณสามารถสร้างหน้าเพิ่มด้วย method AddPage PDF จะยังเปิดอยู่จนกว่า application จะเรียก EndDoc

 

ใช้ properties ของ THotPDF เพื่อกำหนด metadata, output options, compression, security และ viewer behavior ตัวอย่างเช่น PDF encryption และ permissions ถูกควบคุมด้วย property ActivateProtection

 

ตัวอย่างการใช้งาน:

 

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;