THPDFPage.Width

THPDFPage

 

למעלה  הקודם  הבא

Specifies the horizontal size of the page.

 

Delphi syntax:

property Width: integer;

 

C++ syntax:

__property int Width;

 

תיאור

השתמש במאפיין Width כדי לקרוא או לשנות את רוחב העמוד. עבור פורמטי נייר, drawing, card, ID/passport ותמונה סטנדרטיים, העדף את ערכי enum המוגדרים מראש של THPDFPage.Size כגון A2, ‏A3, ‏B2, ‏B4, ‏A5, ‏B5, ‏Tabloid, ‏Ledger, ‏ANSIC, ‏ARCHD ו-P8R. שמות psXXX קיימים נשארים aliases תואמים. השתמש ב-Width ו-Height עם UserDefined רק כאשר הממדים הנדרשים אינם מוגדרים מראש

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.

שמות enum של photo-size משתמשים ב-prefix ‏P כאשר המפרט האמיתי מתחיל בספרה. לדוגמה, P5R מייצג את גודל התמונה 5R הפונה למשתמש

 

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.

 

See also: Height, Size