PDFiumVCL Docs

PageBounds property

Denna API-post behåller identifierare, signaturer, kodblock och PDF-termer i ursprunglig form.
Component: TPdf  ·  Unit: PDFium
Page-level property — the rectangle for the requested page box (MediaBox/CropBox/BleedBox/TrimBox/ArtBox).

Syntax

property PageBounds[Box: TPdfPageBox]: TPdfRectangle;

Description

Returns the the rectangle for the requested page box (MediaBox/CropBox/BleedBox/TrimBox/ArtBox). The value is sourced from the page dictionary in the PDF, after any inherited /MediaBox / /CropBox / /Rotate from parent nodes are resolved.

Read-only unless the property name implies a writer (such as Page or PageRotation); assigning to read-only properties has no effect.

Coordinates and dimensions are reported in PDF user-space points. To convert to pixels for a target DPI, use PointsToPixels(Value, DPI) or the equivalent helpers.

Parameters

BoxWhich page box to retrieve: pbMedia / pbCrop / pbBleed / pbTrim / pbArt.

Remarks

Example

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

See Also

PageBox, GetPageBox, SetPageBox