org.apache.fop.render.extensions.prepress

## Class PageBoundaries

- java.lang.Object
- - org.apache.fop.render.extensions.prepress.PageBoundaries

-     public class PageBoundaries
      extends Object

  This class is used to calculate the effective boundaries of a page including special-purpose boxes used in prepress. These are specified using extension attributes: bleedBox, trimBox and cropBox. The semantics are further described on the website.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static org.apache.xmlgraphics.util.QName` | `EXT_BLEED` The extension attribute for calculating the PDF BleedBox area - specifies the bleed width.
    `static org.apache.xmlgraphics.util.QName` | `EXT_CROP_BOX` The extension attribute for the PDF CropBox area.
    `static org.apache.xmlgraphics.util.QName` | `EXT_CROP_OFFSET` The extension attribute for the PDF CropBox area.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PageBoundaries(Dimension pageSize, Map foreignAttributes)` Creates a new instance.
    `PageBoundaries(Dimension pageSize, String bleed, String cropOffset, String cropBoxSelector)` Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Rectangle` | `getBleedBox()` Returns the bleed box for the page.
    `Rectangle` | `getCropBox()` Returns the crop box for the page.
    `Rectangle` | `getMediaBox()` Returns the media box for the page.
    `Rectangle` | `getTrimBox()` Returns the trim box for the page.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EXT_BLEED

          public static final org.apache.xmlgraphics.util.QName EXT_BLEED

      The extension attribute for calculating the PDF BleedBox area - specifies the bleed width.

    - #### EXT_CROP_OFFSET

          public static final org.apache.xmlgraphics.util.QName EXT_CROP_OFFSET

      The extension attribute for the PDF CropBox area.

    - #### EXT_CROP_BOX

          public static final org.apache.xmlgraphics.util.QName EXT_CROP_BOX

      The extension attribute for the PDF CropBox area.

  - ### Constructor Detail

    - #### PageBoundaries

          public PageBoundaries(Dimension pageSize,
                                String bleed,
                                String cropOffset,
                                String cropBoxSelector)

      Creates a new instance.
      Parameters:
        `pageSize` - the page size (in mpt) defined by the simple-page-master.
        `bleed` - the bleed value (raw value as given in the property value)
        `cropOffset` - the crop-offset value (raw value as given in the property value)
        `cropBoxSelector` - the crop-box, valid values: (trim-box|bleed-box|media-box)

    - #### PageBoundaries

          public PageBoundaries(Dimension pageSize,
                                Map foreignAttributes)

      Creates a new instance.
      Parameters:
        `pageSize` - the page size (in mpt) defined by the simple-page-master.
        `foreignAttributes` - the foreign attributes for the page (used to extract the extension attribute values)

  - ### Method Detail

    - #### getTrimBox

          public Rectangle getTrimBox()

      Returns the trim box for the page. This is equal to the page size given in XSL-FO. After production the printed media is trimmed to this rectangle.
      Returns:
        the trim box

    - #### getBleedBox

          public Rectangle getBleedBox()

      Returns the bleed box for the page.
      Returns:
        the bleed box

    - #### getMediaBox

          public Rectangle getMediaBox()

      Returns the media box for the page.
      Returns:
        the media box

    - #### getCropBox

          public Rectangle getCropBox()

      Returns the crop box for the page. The crop box is used by Adobe Acrobat to select which parts of the document shall be displayed and it also defines the rectangle to which a RIP will clip the document. For bitmap output, this defines the size of the bitmap.
      Returns:
        the crop box

Copyright © 2023 Apache Software Foundation. All rights reserved.