THPDFPage.Width

THPDFPage

 

Arriba  Anterior  Siguiente

Especifica el tamaño horizontal de la página

 

Sintaxis Delphi:

property Width: integer;

 

Sintaxis C++:

__property int Width;

 

Descripción

Usa la propiedad Width para leer o cambiar el ancho de la página. Para formatos estándar de papel, dibujo, tarjeta, ID/pasaporte y foto, prefiere los valores predefinidos del enum THPDFPage.Size, como A2, A3, B2, B4, A5, B5, Tabloid, Ledger, ANSIC, ARCHD y P8R. Los nombres psXXX existentes siguen siendo alias compatibles. Usa Width y Height con UserDefined solo cuando las dimensiones requeridas no estén predefinidas

Tabloid mide 11 x 17 pulgadas. Ledger es el tamaño horizontal de 17 x 11 pulgadas; no trates Ledger como otro nombre para Tabloid vertical

Los nombres de enumeración de tamaños fotográficos usan el prefijo P cuando la especificación real empieza con un dígito. Por ejemplo, P5R representa el tamaño fotográfico 5R visible para el usuario

 

Ejemplo de código

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.

 

Ver también: Height, Size