property PageBox[Box: TPdfPageBox]: TPdfRectangle;
Reads or writes one specific page-box rectangle (pbMedia, pbCrop, pbBleed, pbTrim or pbArt) on the current page. The value is taken from the page dictionary in the PDF once any /MediaBox or /CropBox inherited from parent nodes has been resolved
Assigning a TPdfRectangle to PageBox[Box] updates the matching box on the active page (the same as calling SetPageBox)
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
| Box | Which page box to retrieve: pbMedia / pbCrop / pbBleed / pbTrim / pbArt |
Pdf1.Page; switching the current page transparently updates the values returned hereActive is False the property returns 0, an empty rectangle, or the default enum element
var
R: TPdfRectangle;
begin
if Pdf1.Active then
begin
R := Pdf1.PageBox[pbMedia];
Memo1.Lines.Add(Format('%.2f x %.2f pt', [R.Right - R.Left, R.Top - R.Bottom]));
end;
end;