PDFium Delphi Component Docs

PageBounds 属性

组件: TPdf  ·  单元: PDFium
页面级属性——返回当前页面的包围矩形,单位为 PDF 用户空间点

语法

property PageBounds: TPdfRectangle; // read only

说明

返回当前页面的包围矩形,单位为 PDF 用户空间点。要查询特定的页面框(MediaBox、CropBox、BleedBox、TrimBox 或 ArtBox),请调用 GetPageBox

该属性只读;要修改当前页面上的某个页面框,请给 PageBox[Box] 赋值或调用 SetPageBox

坐标和尺寸以 PDF 用户空间点报告。要转换为目标 DPI 的像素,使用 PointsToPixels(Value, DPI) 或等效辅助函数

备注

示例

var
  R: TPdfRectangle;
begin
  if Pdf1.Active then
  begin
    R := Pdf1.PageBounds;
    Memo1.Lines.Add(Format('%.2f x %.2f pt', [R.Right - R.Left, R.Top - R.Bottom]));
  end;
end;

参见

PageBox, GetPageBox, SetPageBox