|
THPDFPage page-size demo projects Delphi PageSetup 文件夹现在按实际输出尺寸拆分 page-size examples LargeSize demonstrates QuadA0, DoubA0, A0, A1, A2, B0+, B0, B1, B2, ANSI-C/D/E, ARCH-C/D/E1/E, Japanese sheet sizes, large photo sizes, and a 1024 x 768 mm UserDefined page. NormalSize demonstrates A3, Tabloid, Ledger, A4, Letter, A5, B3, B4, B5, medium photo sizes, ANSI-A/B, and ARCH-A/B. SmallSize demonstrates A6-A10, B6-B10, business-card sizes, ISO 7810 ID/passport sizes, ID photo sizes, and small photo print sizes. 现有 psXXX 名称仍是兼容别名。新代码在使用标准尺寸时应优先选择无前缀 page-size enum 值,例如 A0、A2、B2、B3、Tabloid、Ledger、ANSIC、ARCHD、USBC 和 P8R。只有所需尺寸没有预定义时才使用 UserDefined Tabloid 为 11 x 17 英寸。Ledger 是横向的 17 x 11 英寸尺寸;不要把 Ledger 当作纵向 Tabloid 的另一个名称 当真实规格以数字开头时,照片尺寸枚举名称使用 P 前缀。例如,P5R 表示面向用户的 5R 照片尺寸 B-series 值遵循现有 HotPDF B4 / B5 约定,并使用 JIS B 尺寸;psB4 和 psB5 仍作为受支持别名保留 Example: program NormalSize; {$APPTYPE CONSOLE} uses SysUtils, HPDFDoc;
var HPDF: THotPDF;
begin HPDF:= THotPDF.Create( nil ); try HPDF.AutoLaunch := true; // PDF file will be shown automatically HPDF.FileName := 'NormalSize.pdf'; HPDF.PageLayout := plOneColumn; // Set one column viewer mode
HPDF.BeginDoc; // Create PDF file
HPDF.CurrentPage.Size := A3; // Prefer predefined standard sizes HPDF.CurrentPage.TextOut(10, 10, 0, 'A3 Size'); // Print text
HPDF.AddPage; // Add new page HPDF.CurrentPage.Size := B3; // JIS B3 page size HPDF.CurrentPage.TextOut(10, 10, 0, 'B3 Size'); // Print text
HPDF.AddPage; // Add new page HPDF.CurrentPage.Size := P8R; // 8 x 10 inch photo page HPDF.CurrentPage.TextOut(10, 10, 0, '8R Photo Size'); // Print text
HPDF.AddPage; // Add new page HPDF.CurrentPage.Size := Tabloid; // 11 x 17 inch Tabloid page size HPDF.CurrentPage.TextOut(10, 10, 0, 'Tabloid Size'); // Print text
HPDF.AddPage; // Add new page HPDF.CurrentPage.Size := Ledger; // 17 x 11 inch Ledger page size HPDF.CurrentPage.TextOut(10, 10, 0, 'Ledger Size'); // Print text
HPDF.EndDoc; // Close PDF file finally HPDF.Free; end; end.
|