THPDFPage page-size demo projects

La carpeta Delphi PageSetup ahora separa los ejemplos de tamaño de página por tamaño práctico de salida:

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.

Los nombres psXXX existentes siguen siendo alias compatibles. El código nuevo debe preferir valores enum de tamaño de página sin prefijo, como A0, A2, B2, B3, Tabloid, Ledger, ANSIC, ARCHD, USBC y P8R para tamaños estándar. Use UserDefined solo para dimensiones que no estén predefinidas

Tabloid mide 11 x 17 pulgadas. Ledger es el tamaño horizontal de 17 x 11 pulgadas; no trate Ledger como otro nombre para Tabloid vertical

Los nombres de enumeración de tamaños fotográficos usan el prefijo P cuando la especificación real empieza por un dígito. Por ejemplo, P5R representa el tamaño fotográfico 5R visible para el usuario

Los valores de la serie B siguen la convención existente HotPDF B4 / B5 y usan dimensiones JIS B; psB4 y psB5 siguen siendo alias compatibles

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.