THPDFPage page-size demo projects

The Delphi PageSetup folder now separates page-size examples by practical output size:

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.

Existing psXXX names remain compatible aliases. New code should prefer no-prefix page-size enum values such as A0, A2, B2, B3, Tabloid, Ledger, ANSIC, ARCHD, USBC, and P8R for standard sizes. Use UserDefined only for dimensions that are not predefined.

Tabloid is 11 x 17 inches. Ledger is the landscape 17 x 11 inch size; do not treat Ledger as another name for portrait Tabloid.

Photo-size enum names use a P prefix when the real specification starts with a digit. For example, P5R represents the user-facing 5R photo size.

The B-series values follow the existing HotPDF B4 / B5 convention and use JIS B dimensions; psB4 and psB5 remain supported aliases.

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.