THPDFPage.Size

THPDFPage

 

Top  Previous  Next

Specifies the vertical and the horizontal sizes of the page.

 

type

   THPDFPageSize = (UserDefined, Letter, A4, A3, Legal, B5, C5,

     Size8x11, B4, A5, Folio, Executive, EnvB4, EnvB5, EnvC6, EnvDL,

     EnvMonarch, Env9, Env10, Env11, QuadA0, DoubA0, A0, A1, A2,

     B0Plus, B0, B1, B2, B3, ANSIC, ANSID, ANSIE, ARCHC, ARCHD,

     ARCHE1, ARCHE, Shiroku, G1K, Large8K, Standard8K, Crown8K, ROC8K,

     Large16K, Standard16K, Crown16K, ROC16K, P11R, P12R, P16R, P20R, P24R,

     Tabloid, Ledger, P8R, S8R, P10R, ANSIA, ANSIB, ARCHA, ARCHB,

     A6, A7, A8, A9, A10, B6, B7, B8, B9, B10, USBC, EUBC, ASBC,

     ID1, ID2, ID3, OneInch, TwoInch, L2Inch, USVisa, P2R, P3R, P4R,

     P4D, P5R, P6R);

 

Delphi syntax:

property Size: THPDFPageSize;

 

C++ syntax:

__property THPDFPageSize Size;

 

Description:

Use the Size property to read or change the width and the height of the page.

Existing psXXX names remain compatible aliases. For new code, prefer no-prefix page-size enum values such as Letter, A4, B4, A0, A2, B2, B3, Tabloid, Ledger, ANSIC, ARCHD, USBC, and P8R instead of hard-coded custom point dimensions. Use UserDefined only when the required dimensions 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 use JIS B dimensions.

Page-size reference:

Dimensions below are width x height before Orientation is applied.

Office paper: Letter is ANSI/US Letter, 216 x 279 mm (8.5 x 11 in); Legal is North American Legal, 216 x 356 mm (8.5 x 14 in); Tabloid is 279 x 432 mm (11 x 17 in); Ledger is the correct landscape Ledger size, 432 x 279 mm (17 x 11 in); Folio is 216 x 330 mm (8.5 x 13 in); Executive is 184 x 267 mm (7.25 x 10.5 in); Size8x11 is 203 x 279 mm (8 x 11 in).

ISO 216 A-series: QuadA0 is 1682 x 2378 mm; DoubA0 is 1189 x 1682 mm; A0 is 841 x 1189 mm; A1 is 594 x 841 mm; A2 is 420 x 594 mm; A3 is 297 x 420 mm; A4 is 210 x 297 mm; A5 is 148 x 210 mm; A6 is 105 x 148 mm; A7 is 74 x 105 mm; A8 is 52 x 74 mm; A9 is 37 x 52 mm; A10 is 26 x 37 mm.

JIS B-series: B0Plus is oversized B0+, 1118 x 1580 mm; B0 is 1030 x 1456 mm; B1 is 728 x 1030 mm; B2 is 515 x 728 mm; B3 is 364 x 515 mm; B4 is 257 x 364 mm; B5 is 182 x 257 mm; B6 is 128 x 182 mm; B7 is 91 x 128 mm; B8 is 64 x 91 mm; B9 is 45 x 64 mm; B10 is 32 x 45 mm.

Envelope sizes: C5 is ISO 269 C5, 162 x 229 mm; EnvB4 is 257 x 364 mm; EnvB5 is ISO 269 B5, 176 x 250 mm; EnvC6 is ISO 269 C6, 114 x 162 mm; EnvDL is ISO 269 DL, 110 x 220 mm; EnvMonarch is 98 x 191 mm (3.875 x 7.5 in); Env9 is 98 x 225 mm (3.875 x 8.875 in); Env10 is 105 x 241 mm (4.125 x 9.5 in); Env11 is 114 x 263 mm (4.5 x 10.375 in).

Engineering drawings: ANSIA is ANSI/ASME Y14.1 size A, 216 x 279 mm (8.5 x 11 in); ANSIB is size B, 279 x 432 mm (11 x 17 in); ANSIC is size C, 432 x 559 mm (17 x 22 in); ANSID is size D, 559 x 864 mm (22 x 34 in); ANSIE is size E, 864 x 1118 mm (34 x 44 in).

Architectural drawings: ARCHA is 229 x 305 mm (9 x 12 in); ARCHB is 305 x 457 mm (12 x 18 in); ARCHC is 457 x 610 mm (18 x 24 in); ARCHD is 610 x 914 mm (24 x 36 in); ARCHE1 is 762 x 1067 mm (30 x 42 in); ARCHE is 914 x 1219 mm (36 x 48 in).

Japanese sheet sizes: Shiroku is Shirokuban full-size sheet, 787 x 1092 mm; G1K is Kikuban full-size sheet, 635 x 889 mm.

Chinese and Taiwanese octavo (8K) and sextodecimo (16K) sheets: Large8K is 285 x 420 mm; Standard8K is 260 x 370 mm; Crown8K is 210 x 297 mm; ROC8K is 270 x 390 mm; Large16K is 210 x 285 mm; Standard16K is 185 x 260 mm; Crown16K is 148 x 210 mm; ROC16K is 195 x 270 mm. Each 16K sheet is the corresponding 8K sheet folded once along the long edge.

Business cards and identity documents: USBC is North American business card, 88.9 x 50.8 mm (3.5 x 2 in); EUBC is European standard business card, 85 x 55 mm; ASBC is Asian standard business card, 90 x 55 mm; ID1 is ISO/IEC 7810 ID-1, 85.60 x 53.98 mm; ID2 is ISO/IEC 7810 ID-2, 105 x 74 mm; ID3 is ISO/IEC 7810 ID-3, 125 x 88 mm.

ID and passport photos: OneInch is 25 x 35 mm; TwoInch is 35 x 49 mm; L2Inch is 35 x 53 mm; USVisa is 51 x 51 mm (2 x 2 in).

Photo prints: P2R is 63.5 x 88.9 mm (2.5 x 3.5 in); P3R is 88.9 x 127 mm (3.5 x 5 in); P4R is 101.6 x 152.4 mm (4 x 6 in); P4D is 114.3 x 152.4 mm (4.5 x 6 in); P5R is 127 x 177.8 mm (5 x 7 in); P6R is 152.4 x 203.2 mm (6 x 8 in); P8R is 203.2 x 254 mm (8 x 10 in); S8R is 203.2 x 304.8 mm (8 x 12 in); P10R is 254 x 304.8 mm (10 x 12 in); P11R is 279.4 x 355.6 mm (11 x 14 in); P12R is 304.8 x 381 mm (12 x 15 in); P16R is 406.4 x 508 mm (16 x 20 in); P20R is 508 x 609.6 mm (20 x 24 in); P24R is 609.6 x 762 mm (24 x 30 in).

 

Code Example

program PageSizeExample;
{$APPTYPE CONSOLE}
uses
  SysUtils,
  Graphics,
  Classes,
  HPDFDoc;

var
   HPDF: THotPDF;

begin
    HPDF:= THotPDF.Create(  nil  );
    try
        HPDF.AutoLaunch := true;             // PDF file will be shown automatically
        HPDF.FileName := 'PageSizeExample.pdf';
        HPDF.PageLayout := plOneColumn;  // Set one column viewer mode

        HPDF.BeginDoc;                              // Create PDF file

        HPDF.CurrentPage.Size := A3;                      // Prefer predefined sizes
        HPDF.CurrentPage.TextOut(10, 10, 0, 'A3 Size'); // Print text

        HPDF.AddPage;
        HPDF.CurrentPage.Size := B3;
        HPDF.CurrentPage.TextOut(10, 10, 0, 'B3 Size');

        HPDF.AddPage;
        HPDF.CurrentPage.Size := ANSIC;
        HPDF.CurrentPage.TextOut(10, 10, 0, 'ANSI-C Size');

        HPDF.AddPage;
        HPDF.CurrentPage.Size := Tabloid;
        HPDF.CurrentPage.TextOut(10, 10, 0, 'Tabloid 11 x 17 Size');

        HPDF.AddPage;
        HPDF.CurrentPage.Size := Ledger;
        HPDF.CurrentPage.TextOut(10, 10, 0, 'Ledger 17 x 11 Size');

        HPDF.AddPage;
        HPDF.CurrentPage.Size := UserDefined;
        HPDF.CurrentPage.Width := 1024 / 25.4 * 72;    // Custom width in PDF points
        HPDF.CurrentPage.Height := 768 / 25.4 * 72;    // Custom height in PDF points
        HPDF.CurrentPage.TextOut(10, 10, 0, '1024 x 768 mm custom size');

        HPDF.EndDoc;                                                       // Close PDF file
    finally
        HPDF.Free;
    end;
end.

 

See also: Width, Height, Size