|
THPDFPage |
顶部 上一页 下一页 |
|
THPDFPage 表示 PDF 文档中的单个页面
单元 HPDFDoc.pas
说明 用 THPDFPage 绘制路径、放置文本、渲染图像,并控制尺寸、方向和图形状态等页面级设置 文本坐标需要以字体基线(而不是默认的上边缘位置)为参照时,用 常规工作流中,实例由
使用示例:
uses ... HPDFDoc, ...
type ... HPDF: THotPDF; TextBoxResult: THPDFTextOutBoxResult; ...
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.CurrentPage.TextFromBaseLine(true); // 后续文本 Y 值按基线处理 HPDF.CurrentPage.TextOut(10, 40, 0, 'Baseline text'); HPDF.CurrentPage.TextFromBaseLine(false); TextBoxResult := HPDF.CurrentPage.TextOutBoxEx(10, 70, 2, 180, 48, 'Wrapped text-box content', jtLeft); HPDF.CurrentPage.AppendScopedRawContent('2 w 10 10 120 45 re S'); HPDF.EndDoc; // Finalize and save the PDF end;
|