public class PDPage extends Object implements COSObjectable, PDContentStream
| Constructor and Description |
|---|
PDPage()
Creates a new PDPage instance for embedding, with a size of U.S.
|
PDPage(COSDictionary pageDictionary)
Creates a new instance of PDPage for reading.
|
PDPage(PDRectangle mediaBox)
Creates a new instance of PDPage for embedding.
|
| Modifier and Type | Method and Description |
|---|---|
Point |
cropBoxCoordinatesToDraw(Point2D point)
Assuming the rotated crop box is plane where the lower left corner has coordinates 0,0 and assuming the given
point belongs to this plane, it returns the unrotated media box coordinates where this point should be drawn
|
boolean |
equals(Object other) |
PDPageAdditionalActions |
getActions()
Get the page actions.
|
List<PDAnnotation> |
getAnnotations()
This will return a list of the annotations for this page.
|
List<PDAnnotation> |
getAnnotations(AnnotationFilter annotationFilter)
This will return a list of the annotations for this page.
|
PDRectangle |
getArtBox()
A rectangle, expressed in default user space units, defining the extent of the page's meaningful content
(including potential white space) as intended by the page's creator The default is the CropBox.
|
PDRectangle |
getArtBoxRaw() |
PDRectangle |
getBBox()
Returns the bounding box of the contents.
|
PDRectangle |
getBleedBox()
A rectangle, expressed in default user space units, defining the region to which the contents of the page should
be clipped when output in a production environment.
|
PDRectangle |
getBleedBoxRaw() |
InputStream |
getContents()
Returns this stream's content, if any.
|
Iterator<PDStream> |
getContentStreams()
Returns the content streams which make up this page.
|
COSDictionary |
getCOSObject()
Convert this standard java object to a COS object.
|
PDRectangle |
getCropBox()
A rectangle, expressed in default user space units, defining the visible region of default user space.
|
PDRectangle |
getCropBoxRaw() |
Matrix |
getMatrix()
Returns the matrix which transforms from the stream's space to user space.
|
PDRectangle |
getMediaBox()
A rectangle, expressed in default user space units, defining the boundaries of the physical medium on which the
page is intended to be displayed or printed.
|
PDRectangle |
getMediaBoxRaw() |
PDMetadata |
getMetadata()
Get the metadata that is part of the document catalog.
|
ResourceCache |
getResourceCache() |
PDResources |
getResources()
A dictionary containing any resources required by the page.
|
int |
getRotation()
Returns the rotation angle in degrees by which the page should be rotated clockwise when displayed or printed.
|
int |
getStructParents()
This will get the key of this Page in the structural parent tree.
|
List<PDThreadBead> |
getThreadBeads()
This will get a list of PDThreadBead objects, which are article threads in the document.
|
PDTransition |
getTransition() |
PDRectangle |
getTrimBox()
A rectangle, expressed in default user space units, defining the intended dimensions of the finished page after
trimming.
|
PDRectangle |
getTrimBoxRaw() |
List<PDViewportDictionary> |
getViewports()
Get the viewports.
|
boolean |
hasContents()
Returns true if this page has contents.
|
int |
hashCode() |
void |
setActions(PDPageAdditionalActions actions)
Set the page actions.
|
void |
setAnnotations(List<PDAnnotation> annotations)
This will set the list of annotations.
|
void |
setArtBox(PDRectangle artBox)
This will set the ArtBox for this page.
|
void |
setBleedBox(PDRectangle bleedBox)
This will set the BleedBox for this page.
|
void |
setContents(List<PDStream> contents)
This will set the contents of this page.
|
void |
setContents(PDStream contents)
This will set the contents of this page.
|
void |
setCropBox(PDRectangle cropBox)
This will set the CropBox for this page.
|
void |
setMediaBox(PDRectangle mediaBox)
This will set the mediaBox for this page.
|
void |
setMetadata(PDMetadata meta)
Set the metadata for this object.
|
void |
setResources(PDResources resources)
This will set the resources for this page.
|
void |
setRotation(int rotation)
This will set the rotation for this page.
|
void |
setStructParents(int structParents)
This will set the key for this page in the structural parent tree.
|
void |
setThreadBeads(List<PDThreadBead> beads)
This will set the list of thread beads.
|
void |
setTransition(PDTransition transition) |
void |
setTransition(PDTransition transition,
float duration)
Convenient method to set a transition and the display duration
|
void |
setTrimBox(PDRectangle trimBox)
This will set the TrimBox for this page.
|
void |
setViewports(List<PDViewportDictionary> viewports)
Set the viewports.
|
public PDPage()
public PDPage(PDRectangle mediaBox)
mediaBox - The MediaBox of the page.public PDPage(COSDictionary pageDictionary)
pageDictionary - A page dictionary in a PDF document.public COSDictionary getCOSObject()
getCOSObject in interface COSObjectablepublic Iterator<PDStream> getContentStreams()
public InputStream getContents() throws IOException
PDContentStreamgetContents in interface PDContentStreamIOException - If the stream could not be readpublic boolean hasContents()
public PDResources getResources()
getResources in interface PDContentStreampublic void setResources(PDResources resources)
resources - The new resources for this page.public int getStructParents()
public void setStructParents(int structParents)
structParents - The new key for this page.public PDRectangle getBBox()
PDContentStreamgetBBox in interface PDContentStreampublic Matrix getMatrix()
PDContentStreamgetMatrix in interface PDContentStreampublic PDRectangle getMediaBox()
public PDRectangle getMediaBoxRaw()
public void setMediaBox(PDRectangle mediaBox)
mediaBox - The new mediaBox for this page.public PDRectangle getCropBox()
public PDRectangle getCropBoxRaw()
public void setCropBox(PDRectangle cropBox)
cropBox - The new CropBox for this page.public PDRectangle getBleedBox()
public PDRectangle getBleedBoxRaw()
public void setBleedBox(PDRectangle bleedBox)
bleedBox - The new BleedBox for this page.public PDRectangle getTrimBox()
public PDRectangle getTrimBoxRaw()
public void setTrimBox(PDRectangle trimBox)
trimBox - The new TrimBox for this page.public PDRectangle getArtBox()
public PDRectangle getArtBoxRaw()
public void setArtBox(PDRectangle artBox)
artBox - The new ArtBox for this page.public int getRotation()
public void setRotation(int rotation)
rotation - The new rotation for this page in degrees.public void setContents(PDStream contents)
contents - The new contents of the page.public void setContents(List<PDStream> contents)
contents - Array of new contents of the page.public List<PDThreadBead> getThreadBeads()
public void setThreadBeads(List<PDThreadBead> beads)
beads - A list of PDThreadBead objects or null.public PDMetadata getMetadata()
public void setMetadata(PDMetadata meta)
meta - The meta data for this object.public PDPageAdditionalActions getActions()
public void setActions(PDPageAdditionalActions actions)
actions - The actions for the page.public PDTransition getTransition()
public void setTransition(PDTransition transition)
transition - The new transition to set on this page.public void setTransition(PDTransition transition, float duration)
transition - The new transition to set on this page.duration - The maximum length of time, in seconds, that the page shall be displayed during presentations
before the viewer application shall automatically advance to the next page.public List<PDAnnotation> getAnnotations()
public List<PDAnnotation> getAnnotations(AnnotationFilter annotationFilter)
annotationFilter - the annotation filter provided allowing to filter out specific annotationspublic Point cropBoxCoordinatesToDraw(Point2D point)
point - public void setAnnotations(List<PDAnnotation> annotations)
annotations - The new list of annotations.public ResourceCache getResourceCache()
public List<PDViewportDictionary> getViewports()
public void setViewports(List<PDViewportDictionary> viewports)
viewports - A list of viewports, or null if the entry is to be deleted.Copyright © 2019 sejda. All rights reserved.