Docs de PDFiumVCL

PageHeight property

Esta entrada API conserva identificadores, firmas, bloques de código y términos PDF en su forma original.
Component: TPdf  ·  Unit: PDFium
Height of the active page in PDF user-space units (points = 1/72 inch).

Syntax

property PageHeight: Double; // read only

Description

PageHeight returns the height of the currently active page in PDF default user space units, where 1 unit = 1/72 of an inch (1 point). The value reflects the page’s effective MediaBox after rotation has been applied — a 595 × 842 point A4 page rotated 90° reports PageWidth = 842 and PageHeight = 595.

The value is 0 when Active is False. Page sizes in PDF are doubles, not integers; A4 is exactly 841.8898 points tall (210 mm ÷ 25.4 × 72), letter is 792. Multiply by 25.4 / 72 to convert to millimetres, or by 1 / 72 for inches. Apply Zoom (TPdfView) to translate user-space to screen pixels.

The dimensions come from the page’s MediaBox unless the PDF specifies a smaller CropBox / TrimBox / BleedBox / ArtBox. Use PageBox[Box] to read any of the alternative boxes explicitly — print workflows typically operate on TrimBox or BleedBox rather than MediaBox.

Remarks

Example

var WidthMM, HeightMM: Double;
Pdf1.Active := True;
Pdf1.PageNumber := 1;
WidthMM := Pdf1.PageWidth * 25.4 / 72;
HeightMM := Pdf1.PageHeight * 25.4 / 72;
Label1.Caption := Format('Page 1: %.1f x %.1f mm', [WidthMM, HeightMM]);

See Also

PageWidth, PageRotation, PageBox, PageBounds