THPDFPage.Width

THPDFPage

 

맨 위  이전  다음

Specifies the horizontal size of the page.

 

Delphi 구문:

property Width: integer;

 

C++ 구문:

__property int Width;

 

설명

Page width를 읽거나 변경하려면 Width property를 사용하십시오. Standard paper, drawing, card, ID/passport, photo format에는 A2, A3, B2, B4, A5, B5, Tabloid, Ledger, ANSIC, ARCHD, P8R 같은 predefined THPDFPage.Size enum value를 선호하십시오. 기존 psXXX name은 compatible alias로 유지됩니다. 필요한 dimension이 predefined되어 있지 않을 때만 UserDefined와 함께 WidthHeight를 사용하십시오

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 name은 실제 specification이 숫자로 시작할 때 P prefix를 사용합니다. 예를 들어 P5R은 user-facing 5R photo size를 나타냅니다

 

Code Example

program CustomPageSize;
{$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 := 'CustomPageSize.pdf';  // Set PDF filename
        HPDF.PageLayout := plOneColumn;  // Set one column viewer mode

        HPDF.BeginDoc;                              // Create PDF file

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

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

 

참조: Height, Size