Instance Method

boundsForBox:

Returns the bounds for the specified PDF display box.

Declaration

iOS, Mac Catalyst
- (CGRect)boundsForBox:(PDFDisplayBox)box;
macOS
- (NSRect)boundsForBox:(PDFDisplayBox)box;

Discussion

The PDFDisplayBox enumeration defines the various box types (see Supporting Types for additional information about box types).

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.

boundsForBox throws a range exception if box is not in range.

See Also

Getting Information About a Page

document

Returns the PDFDocument object with which the page is associated.

label

Returns the label for the page.

- setBounds:forBox:

Sets the bounds for the specified box.

rotation

Sets the rotation angle for the page in degrees.