Specifies the vertical and the horizontal sizes of the page.
type
THPDFPageSize = (psUserDefined, psLetter, psA4, psA3, psLegal, psB5, psC5,
ps8x11, psB4, psA5, psFolio, psExecutive, psEnvB4, psEnvB5,
psEnvC6, psEnvDL, psEnvMonarch, psEnv9, psEnv10, psEnv11);
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.
Code Example
program MultiSize;
{$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 := '\MultiSize.pdf'; // Set PDF filename
HPDF.PageLayout := plOneColumn; // Set one column viewer mode
HPDF.BeginDoc; // Create PDF file
HPDF.CurrentPage.Size := psA3; // Set A3 page size
HPDF.CurrentPage.TextOut(10, 10, 0, 'A3 Size'); // Print text
HPDF.AddPage; // Add new page
HPDF.CurrentPage.Width := 600; // Set Page Width
HPDF.CurrentPage.Height := 400; // Set Page Height
HPDF.CurrentPage.TextOut(10, 10, 0, '600 X 400 Page size'); // Print text
HPDF.AddPage; // Add new page
HPDF.CurrentPage.Size := ps8x11; // Set 8x11 page size
HPDF.CurrentPage.Orientation := poLandscape; // Set landscape page orientation
HPDF.CurrentPage.TextOut(10, 10, 0, '8x11 Size'); // Print text
HPDF.AddPage; // Add new page
HPDF.CurrentPage.Size := psA4; // Set A4 page size
HPDF.CurrentPage.TextOut(10, 10, 0, 'Letter Size'); // Print text
HPDF.EndDoc; // Close PDF file
finally
HPDF.Free;
end;
end.
See also: Width, Height, Size
|