property PageHeight: Double; // read only
PageHeight 返回当前活动页面的高度,单位为 PDF 默认用户
空间单位,其中 1 单位 = 1/72 英寸(1 点)。该值反映
应用旋转后页面的有效 MediaBox — 旋转 90° 的 595 ×
842 点 A4 页面报告 PageWidth = 842 和
PageHeight = 595
当 Active 为 False 时值为 0。PDF 中的页面
尺寸是 double 而非整数;A4 恰好为 841.8898 点
高(210 mm ÷ 25.4 × 72),letter 为 792。乘以
25.4 / 72 转换为毫米,或乘以 1 / 72 得到英寸
应用 Zoom(TPdfView)将用户空间转换为屏幕像素
除非 PDF 指定了更小的
CropBox / TrimBox / BleedBox / ArtBox,否则尺寸来自页面的 MediaBox。使用 PageBox[Box] 显式读取
任何替代框 — 打印工作流通常操作
TrimBox 或 BleedBox 而非 MediaBox
PageRotation 时会改变:对于 90° / 270° 旋转,PDFium 会自动交换宽度 / 高度PageNumber 后务必重新读取 PageHeight
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]);