Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  


Returns the bounds for the specified PDF display box.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
PDFKit 2.9 Yes No Yes, macOS only No Yes

MBS( "PDFKit.PageBounds"; PDF; index { ; box; mm } )


Parameter Description Example value
PDF A container value with the PDF content from a media field. Or a text with an URL. Or a PDF reference from PDFKit.Open.
index The index of the page. From zero to PDFKit.GetPDFPageCount-1. 1
box Optional
Optionally, the PDF box to use. Can be Media Box = 0, Crop Box = 1, Bleed Box = 2, TrimBox = 3 or ArtBox = 4. If the box is not defined, we fall back to the media box. Default is 0.
mm Optional
Optionally. If you pass 1, we convert the rectangle to millimeters. Else we return points where 72 points are one inch. Default is 0.


Returns four values separated with new line containing x, y, width and height.


Returns the bounds for the specified PDF display box.
Note that only the media box is required for a PDF. If you request the bounds for the crop box, but the PDF does not include a crop box, the bounds for the media box are returned instead. If you request the bounds for other box types, and the PDF does not includes these types, the bounds for the crop box are returned instead.
The coordinates for the box are in page space, so you might need to transform the points if the page has a rotation on it. Also, note that the bounds boundsForBox returns are intersected with the page's media box.


Get media box of third page in a PDF in a container field:

MBS("PDFKit.PageBounds"; test::data; 2; 0)

Get crop box of sixth page in millimeters in a PDF with reference:

MBS("PDFKit.PageBounds"; $ref; 5; 1; 1)

See also

PDFKit.OpenURL   -   PDFKit.Print

Feedback: Report problem or ask question.

MBS Xojo Chart Plugins