Package org.apache.fop.pdf
Class PDFPage
java.lang.Object
org.apache.fop.pdf.PDFObject
org.apache.fop.pdf.PDFDictionary
org.apache.fop.pdf.PDFResourceContext
org.apache.fop.pdf.PDFPage
- All Implemented Interfaces:
PDFWritable
Class representing a /Page object.
There is one of these for every page in a PDF document. The object specifies the dimensions of the page and references a /Resources object, a contents stream and the page's parent in the page hierarchy.
-
Field Summary
FieldsFields inherited from class org.apache.fop.pdf.PDFDictionary
entries, order -
Constructor Summary
ConstructorsConstructorDescriptionPDFPage(PDFResources resources, int pageIndex, Rectangle2D mediaBox, Rectangle2D cropBox, Rectangle2D bleedBox, Rectangle2D trimBox) Create a /Page object -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of the StructParents entry.voidsetBleedBox(Rectangle2D box) Sets the "BleedBox" entryvoidsetContents(PDFReference contents) set this page contentsvoidsetCropBox(Rectangle2D box) Sets the "CropBox" entryvoidsetMediaBox(Rectangle2D box) Sets the "MediaBox" entryvoidsetMetadata(PDFMetadata meta) voidset this page's parentvoidsetStructParents(int structParents) Sets the "StructParents" value.voidSpecifies the tab order for annotations on a page.voidsetTransition(int dur, TransitionDictionary tr) Set the transition dictionary and duration.voidsetTrimBox(Rectangle2D box) Sets the "TrimBox" entryMethods inherited from class org.apache.fop.pdf.PDFResourceContext
addAnnotation, addGState, addPattern, addShading, addXObject, getAnnotations, getGStates, getPatterns, getPDFResources, getShadings, getXObjectsMethods inherited from class org.apache.fop.pdf.PDFDictionary
containsKey, get, getChildren, getChildren, keySet, output, put, put, remove, writeDictionaryMethods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
-
Field Details
-
pageIndex
protected int pageIndexthe page index (zero-based)
-
-
Constructor Details
-
PDFPage
public PDFPage(PDFResources resources, int pageIndex, Rectangle2D mediaBox, Rectangle2D cropBox, Rectangle2D bleedBox, Rectangle2D trimBox) Create a /Page object- Parameters:
resources- the /Resources objectpageIndex- the page's zero-based index (or -1 if the page number is auto-determined)mediaBox- the MediaBoxcropBox- the CropBox. If null, mediaBox is used.bleedBox- the BleedBox. If null, cropBox is used.trimBox- the TrimBox. If null, bleedBox is used.
-
-
Method Details
-
setMediaBox
Sets the "MediaBox" entry- Parameters:
box- the media rectangle
-
setCropBox
Sets the "CropBox" entry- Parameters:
box- the bleed rectangle
-
setBleedBox
Sets the "BleedBox" entry- Parameters:
box- the bleed rectangle
-
setTrimBox
Sets the "TrimBox" entry- Parameters:
box- the trim rectangle
-
setContents
set this page contents- Parameters:
contents- the contents of the page
-
setParent
set this page's parent- Parameters:
parent- the /Pages object that is this page's parent
-
setTransition
Set the transition dictionary and duration. This sets the duration of the page and the transition dictionary used when going to the next page.- Parameters:
dur- the duration in secondstr- the transition dictionary
-
getPageIndex
public int getPageIndex()- Returns:
- the page Index of this page (zero-based), -1 if it the page index should automatically be determined.
-
setStructParents
public void setStructParents(int structParents) Sets the "StructParents" value.- Parameters:
structParents- the integer key of this object's entry in the structural parent tree.
-
getStructParents
Returns the value of the StructParents entry.- Returns:
- the StructParents value,
nullif the entry has not been set
-
setTabs
Specifies the tab order for annotations on a page.- Parameters:
value- one of the allowed values (see PDF 1.5)- Since:
- PDF 1.5
-
setMetadata
-