|
THotPDF |
傳回頂部 上一頁 下一頁 |
|
THotPDF is the main class used to create and manage PDF documents.
單元 HPDFDoc
說明 使用 THotPDF 從你的 application 產生 PDF documents。Document generation 會從呼叫 BeginDoc 開始。Drawing 與 text output 會透過 CurrentPage property 執行,你也可以使用 AddPage method 建立其他頁面。PDF 會保持開啟,直到 application 呼叫 EndDoc
使用 THotPDF properties 設定 metadata、output options、compression、security 與 viewer behavior。例如,PDF encryption 與 permissions 由 ActivateProtection property 控制
使用範例:
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;
HPDF.CurrentPage.TextOut(10, 10, 0, 'Hello World!'); // Write text on the first page HPDF.EndDoc; // Finalize and save the PDF end;
|