Declaration
property PDF_PaperWidth: Integer;
Description
Specifies the width of the page in Adobe PDF points (1 point = 1/72 of inch). Default values are width: 595 and height: 842 (A4 format).
Alternatively, you can use
PDF_PaperSize and
PDF_PaperLayout.
Note:
◼This property is only used when saving PDF files natively, e.g. using
TImageEnIO.SaveToFilePDF or
TImageEnMIO.SaveToFilePDF (and the
PdfViewer is disabled). It is NOT used when saving with
PDFium◼If you set PDF_PaperWidth and
PDF_PaperHeight to 0 the page will be output at the size of the image. Note: This may create huge pages!
◼If you are using a
TIEMultiBitmap or
TImageEnMView, you can use
DuplicateCompressionInfo to propogate the parameter to all frames
Common values:
Paper Size | PDF_PaperWidth | PDF_PaperHeight |
A0 | 2380 | 3368 |
A1 | 1684 | 2380 |
A2 | 1190 | 1684 |
A3 | 842 | 1190 |
A4 | 595 | 842 |
A5 | 421 | 595 |
A6 | 297 | 421 |
B5 | 501 | 709 |
US Letter (8.5 x 11") | 612 | 792 |
US Legal (8.5 x 14") | 612 | 1008 |
US Ledger (17 x 11") | 1224 | 792 |
US Tabloid (11 x 17") | 792 | 1224 |
Default: 595
// Save image in TImageEnMView as PDF with "US Letter" paper size
ImageEnView1.IO.Params.PDF_PaperWidth := 612;
ImageEnView1.IO.Params.PDF_PaperHeight := 792;
ImageEnView1.IO.SaveToFile('D:\output.pdf');
// Save multi-frame image in TImageEnMView as PDF with "US Letter" paper size
for i := 0 to ImageEnMView1.MIO.ParamsCount - 1 do
begin
ImageEnMView1.MIO.Params[i].PDF_PaperWidth := 612;
ImageEnMView1.MIO.Params[i].PDF_PaperHeight := 792;
end;
ImageEnMView1.MIO.SaveToFile('D:\output.pdf');
// Convert a TIFF to PDF with "US Letter" paper size
mbmp := TIEMultiBitmap.Create();
mbmp.ParamsEnabled := True;
mbmp.LoadFromFile('D:\Input.tif');
for i := 0 to mbmp.Count-1 do
begin
mbmp.Params[i].PDF_PaperWidth := 612;
mbmp.Params[i].PDF_PaperHeight := 792;
mbmp.Params[i].PDF_Compression := ioPDF_JPEG;
mbmp.Params[i].JPEG_Quality := 90;
end;
mbmp.SaveToFile('D:\Output.pdf');
mbmp.Free;