public class PDFPage extends PDFResourceContext
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.
| Modifier and Type | Field and Description |
|---|---|
protected int |
pageIndex
the page index (zero-based)
|
entries, order| Constructor and Description |
|---|
PDFPage(PDFResources resources,
int pageIndex,
Rectangle2D mediaBox,
Rectangle2D cropBox,
Rectangle2D bleedBox,
Rectangle2D trimBox)
Create a /Page object
|
| Modifier and Type | Method and Description |
|---|---|
int |
getPageIndex() |
Integer |
getStructParents()
Returns the value of the StructParents entry.
|
void |
setBleedBox(Rectangle2D box)
Sets the "BleedBox" entry
|
void |
setContents(PDFReference contents)
set this page contents
|
void |
setCropBox(Rectangle2D box)
Sets the "CropBox" entry
|
void |
setMediaBox(Rectangle2D box)
Sets the "MediaBox" entry
|
void |
setMetadata(PDFMetadata meta) |
void |
setParent(PDFPages parent)
set this page's parent
|
void |
setStructParents(int structParents)
Sets the "StructParents" value.
|
void |
setTabs(PDFName value)
Specifies the tab order for annotations on a page.
|
void |
setTransition(int dur,
TransitionDictionary tr)
Set the transition dictionary and duration.
|
void |
setTrimBox(Rectangle2D box)
Sets the "TrimBox" entry
|
addAnnotation, addGState, addPattern, addShading, addXObject, getAnnotations, getGStates, getPatterns, getPDFResources, getShadings, getXObjectscontainsKey, get, getChildren, getChildren, keySet, output, put, put, remove, writeDictionarycontentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFStringpublic PDFPage(PDFResources resources, int pageIndex, Rectangle2D mediaBox, Rectangle2D cropBox, Rectangle2D bleedBox, Rectangle2D trimBox)
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.public void setMediaBox(Rectangle2D box)
box - the media rectanglepublic void setCropBox(Rectangle2D box)
box - the bleed rectanglepublic void setBleedBox(Rectangle2D box)
box - the bleed rectanglepublic void setTrimBox(Rectangle2D box)
box - the trim rectanglepublic void setContents(PDFReference contents)
contents - the contents of the pagepublic void setParent(PDFPages parent)
parent - the /Pages object that is this page's parentpublic void setTransition(int dur,
TransitionDictionary tr)
dur - the duration in secondstr - the transition dictionarypublic int getPageIndex()
public void setStructParents(int structParents)
structParents - the integer key of this object's entry in the structural parent tree.public Integer getStructParents()
null if the entry has not been setpublic void setTabs(PDFName value)
value - one of the allowed values (see PDF 1.5)public void setMetadata(PDFMetadata meta)
Copyright © 2023 Apache Software Foundation. All rights reserved.