Class PageBoundaries
java.lang.Object
org.apache.fop.render.extensions.prepress.PageBoundaries
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
FieldsModifier and TypeFieldDescriptionprivate Rectangle
private Rectangle
static final org.apache.xmlgraphics.util.QName
The extension attribute for calculating the PDF BleedBox area - specifies the bleed width.static final org.apache.xmlgraphics.util.QName
The extension attribute for the PDF CropBox area.static final org.apache.xmlgraphics.util.QName
The extension attribute for the PDF CropBox area.private Rectangle
private static final Pattern
private Rectangle
private static final Pattern
-
Constructor Summary
ConstructorsConstructorDescriptionPageBoundaries
(Dimension pageSize, String bleed, String cropOffset, String cropBoxSelector) Creates a new instance.PageBoundaries
(Dimension pageSize, Map foreignAttributes) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Returns the bleed box for the page.private static Rectangle
getBleedBoxRectangle
(Rectangle trimBox, String bleed) The BleedBox is calculated by expanding the TrimBox by the bleed widths.Returns the crop box for the page.private static Rectangle
getCropMarksAreaRectangle
(Rectangle trimBox, String cropOffsets) The MediaBox is calculated by expanding the TrimBox by the crop offsets.private static int
getLengthIntValue
(String length) Returns the media box for the page.private static Rectangle
getRectangleUsingOffset
(Rectangle originalRect, String offset) Returns the trim box for the page.
-
Field Details
-
EXT_BLEED
public static final org.apache.xmlgraphics.util.QName EXT_BLEEDThe 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_OFFSETThe extension attribute for the PDF CropBox area. -
EXT_CROP_BOX
public static final org.apache.xmlgraphics.util.QName EXT_CROP_BOXThe extension attribute for the PDF CropBox area. -
SIZE_UNIT_PATTERN
-
WHITESPACE_PATTERN
-
trimBox
-
bleedBox
-
mediaBox
-
cropBox
-
-
Constructor Details
-
PageBoundaries
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
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 Details
-
calculate
-
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
Returns the bleed box for the page.- Returns:
- the bleed box
-
getMediaBox
Returns the media box for the page.- Returns:
- the media box
-
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
-
getBleedBoxRectangle
The BleedBox is calculated by expanding the TrimBox by the bleed widths.- Parameters:
trimBox
- the TrimBox rectanglebleed
- the given bleed widths- Returns:
- the calculated BleedBox rectangle
-
getCropMarksAreaRectangle
The MediaBox is calculated by expanding the TrimBox by the crop offsets.- Parameters:
trimBox
- the TrimBox rectanglecropOffsets
- the given crop offsets- Returns:
- the calculated MediaBox rectangle
-
getRectangleUsingOffset
-
getLengthIntValue
-