|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.Dictionary
org.icepdf.core.pobjects.Page
public class Page
This class represents the leaves of a PageTree object known
as Page class. The page dictionary specifies attributes
of the single page of the document. Many of the page's attributes are
inherited from the page tree dictionary if not specified in the page
dictionary.
The page object also provides a method which will extract a page's content,
such as text and images. The paint method is the core of
the ICEpdf renderer, allowing page content to be painted to any Java graphics
context.
Page objects in a PDF document have different boundaries defined which govern various aspects of the pre-press process, such as cropping, bleed, and trimming. Facilities for including printer's marks, such a registration targets, gray ramps color bars, and cut marks which assist in the production process. When getting a page's size, the default boundary used is the crop box which is what most viewer applications should use. However, if your application requires the use of different page boundaries, they can be specified when using the getSize or paint methods. If in doubt, always use the crop box constant.
PageTree| Field Summary | |
|---|---|
static Name |
ANNOTS_KEY
|
static int |
BOUNDARY_ARTBOX
Defines the extent of the page's meaningful content as intended by the page's creator. |
static int |
BOUNDARY_BLEEDBOX
Defines the region to which the contents of the page should be clipped when output in a production environment (Mainly commercial printing). |
static int |
BOUNDARY_CROPBOX
Defines the visible region of the default user space. |
static int |
BOUNDARY_MEDIABOX
Defines the boundaries of the physical medium on which the page is intended to be displayed or printed. |
static int |
BOUNDARY_TRIMBOX
Defines the intended dimensions of the finished page after trimming. |
static Name |
CONTENTS_KEY
|
| Fields inherited from class org.icepdf.core.pobjects.Dictionary |
|---|
entries, inited, isDeleted, isNew, library, SUBTYPE_KEY, TYPE_KEY |
| Constructor Summary | |
|---|---|
Page(Library l,
java.util.Hashtable h)
Create a new Page object. |
|
| Method Summary | |
|---|---|
Annotation |
addAnnotation(Annotation newAnnotation)
Adds an annotation that was previously added to the document. |
void |
addPaintPageListener(PaintPageListener listener)
|
Annotation |
createAnnotation(java.awt.Rectangle rect,
AnnotationState annotationState)
Creates a new annotation instance for his page. |
void |
deleteAnnotation(Annotation annot)
Deletes the specified annotation instance from his page. |
protected void |
dispose(boolean cache)
Dispose the Page. |
java.util.ArrayList<Annotation> |
getAnnotations()
Gets all annotation information associated with this page. |
java.awt.geom.Rectangle2D.Float |
getArtBox()
Gets the art box boundary defined by this page. |
java.awt.geom.Rectangle2D.Float |
getBleedBox()
Gets the bleed box boundary defined by this page. |
java.awt.geom.Rectangle2D.Double |
getBoundingBox(float userRotation)
Get the bounding box that the page can occupy, given the userRotation and page's own pageRotation. |
java.awt.geom.Rectangle2D.Double |
getBoundingBox(float userRotation,
float userZoom)
Get the bounding box that the page can occupy, given the userRotation, userZoom, page's own pageRotation. |
java.awt.geom.Rectangle2D.Double |
getBoundingBox(int boundary,
float userRotation,
float userZoom)
Get the bounding box that the page can occupy, given the userRotation, userZoom, page's own pageRotation and cropBox boundary. |
java.awt.geom.Rectangle2D.Float |
getCropBox()
Gets the crop box boundary defined by this page. |
java.lang.String[] |
getDecodedContentSteam()
Returns the decoded content stream for this page instance. |
java.util.Vector |
getImages()
Gets a vector of Images where each index represents an image inside this page. |
java.awt.geom.Rectangle2D.Float |
getMediaBox()
Gets the media box boundary defined by this page. |
PRectangle |
getPageBoundary(int specifiedBox)
Utility method for appling the page boundary rules. |
java.awt.Shape |
getPageShape(int boundary,
float userRotation,
float userZoom)
This method returns a Shape that represents the outline of this Page, after being rotated and zoomed. |
java.awt.geom.AffineTransform |
getPageTransform(int boundary,
float userRotation,
float userZoom)
The Java Graphics coordinate system has the origin at the top-left of the screen, with Y values increasing as one moves down the screen. |
PageTree |
getParent()
Gets the page's parent page tree. |
protected Reference |
getParentReference()
Gets a reference to the page's parent page tree. |
Resources |
getResources()
|
PDimension |
getSize(float userRotation)
Get the width and height that the page can occupy, given the userRotation, page's own pageRotation and cropBox boundary. |
PDimension |
getSize(float userRotation,
float userZoom)
Get the width and height that the page can occupy, given the userRotation, userZoom, page's own pageRotation and cropBox boundary. |
PDimension |
getSize(int boundary,
float userRotation,
float userZoom)
Get the width and height that the page can occupy, given the userRotation, userZoom, page's own pageRotation and cropBox boundary. |
PageText |
getText()
Gest the PageText data structure for this page using an accelerated parsing technique that ignores some text elements. |
Thumbnail |
getThumbnail()
Gets a Thumbnail object associated with this page. |
float |
getTotalRotation(float userRotation)
Gets the total rotation factor of the page after applying a user rotation factor. |
java.awt.geom.Rectangle2D.Float |
getTrimBox()
Gets the trim box boundary defined by this page. |
PageText |
getViewText()
Gest the PageText data structure for this page. |
void |
init()
Initialize the Page object. |
boolean |
isInitiated()
|
void |
notifyPaintPageListeners()
|
void |
paint(java.awt.Graphics g,
int renderHintType,
int boundary,
float userRotation,
float userZoom)
|
void |
paint(java.awt.Graphics g,
int renderHintType,
int boundary,
float userRotation,
float userZoom,
PageViewComponentImpl.PagePainter pagePainter)
Paints the contents of this page to the graphics context using the specified rotation, zoom, rendering hints and page boundary. |
void |
paint(java.awt.Graphics g,
int renderHintType,
int boundary,
float userRotation,
float userZoom,
PageViewComponentImpl.PagePainter pagePainter,
boolean paintAnnotations,
boolean paintSearchHighlight)
Paints the contents of this page to the graphics context using the specified rotation, zoom, rendering hints and page boundary. |
void |
reduceMemory()
Reduces the amount of memory used by this object. |
void |
removePaintPageListener(PaintPageListener listener)
|
java.lang.String |
toString()
Returns a summary of the page dictionary entries. |
boolean |
updateAnnotation(Annotation annotation)
Updates the annotation associated with this page. |
| Methods inherited from class org.icepdf.core.pobjects.Dictionary |
|---|
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getObject, getPObjectReference, isDeleted, isNew, setDeleted, setNew, setPObjectReference |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.icepdf.core.util.MemoryManageable |
|---|
getLibrary |
| Field Detail |
|---|
public static final Name ANNOTS_KEY
public static final Name CONTENTS_KEY
public static final int BOUNDARY_MEDIABOX
public static final int BOUNDARY_CROPBOX
public static final int BOUNDARY_BLEEDBOX
public static final int BOUNDARY_TRIMBOX
public static final int BOUNDARY_ARTBOX
| Constructor Detail |
|---|
public Page(Library l,
java.util.Hashtable h)
l - pointer to default library containing all document objectsh - hashtable containing all of the dictionary entries| Method Detail |
|---|
protected void dispose(boolean cache)
cache - if true, cached files are removed; otherwise, objects are freed
but object caches are left intact.public boolean isInitiated()
public void init()
init in class Dictionarypublic Thumbnail getThumbnail()
public void paint(java.awt.Graphics g,
int renderHintType,
int boundary,
float userRotation,
float userZoom)
public void paint(java.awt.Graphics g,
int renderHintType,
int boundary,
float userRotation,
float userZoom,
PageViewComponentImpl.PagePainter pagePainter)
g - graphics context to which the page content will be painted.renderHintType - Constant specified by the GraphicsRenderingHints class.
There are two possible entries, SCREEN and PRINT, each with configurable
rendering hints settings.boundary - Constant specifying the page boundary to use when
painting the page content.userRotation - Rotation factor, in degrees, to be applied to the rendered pageuserZoom - Zoom factor to be applied to the rendered pagepagePainter - class which will receive paint events.
public void paint(java.awt.Graphics g,
int renderHintType,
int boundary,
float userRotation,
float userZoom,
PageViewComponentImpl.PagePainter pagePainter,
boolean paintAnnotations,
boolean paintSearchHighlight)
g - graphics context to which the page content will be painted.renderHintType - Constant specified by the GraphicsRenderingHints class.
There are two possible entries, SCREEN and PRINT, each with configurable
rendering hints settings.boundary - Constant specifying the page boundary to use when
painting the page content.userRotation - Rotation factor, in degrees, to be applied to the rendered pageuserZoom - Zoom factor to be applied to the rendered pagepagePainter - class which will receive paint events.paintAnnotations - true enables the painting of page annotations. False
paints no annotaitons for a given page.paintSearchHighlight - true enables the painting of search highlight
state of text object. The search controller can
be used to easily search and add highlighted state
for search terms.
public java.awt.geom.AffineTransform getPageTransform(int boundary,
float userRotation,
float userZoom)
boundary - Constant specifying the page boundary to use when
painting the page content.userRotation - Rotation factor, in degrees, to be applied to the rendered pageuserZoom - Zoom factor to be applied to the rendered page
public java.awt.Shape getPageShape(int boundary,
float userRotation,
float userZoom)
boundary - Constant specifying the page boundary to useuserRotation - Rotation factor, in degrees, to be applieduserZoom - Zoom factor to be applied
public Annotation createAnnotation(java.awt.Rectangle rect,
AnnotationState annotationState)
rect - location of new rectangleannotationState - annotation state to use for default values. Null
is allowed if default state is prefered.
public Annotation addAnnotation(Annotation newAnnotation)
newAnnotation -
public void deleteAnnotation(Annotation annot)
public boolean updateAnnotation(Annotation annotation)
annotation - annotation object that should be updated for this page.
protected Reference getParentReference()
Librarypublic PageTree getParent()
public PDimension getSize(float userRotation)
userRotation - Rotation factor specified by the user under which the
page will be rotated.
getSize(float, float)
public PDimension getSize(float userRotation,
float userZoom)
userRotation - rotation factor specified by the user under which the
page will be rotated.userZoom - zoom factor specifed by the user under which the page will
be rotated.
public PDimension getSize(int boundary,
float userRotation,
float userZoom)
boundary - boundary constant to specify which boundary to respect when
calculating the page's size.userRotation - rotation factor specified by the user under which the
page will be rotated.userZoom - zoom factor specified by the user under which the page will
be rotated.
public java.awt.geom.Rectangle2D.Double getBoundingBox(float userRotation)
userRotation - Rotation factor specified by the user under which the
page will be rotated.
getSize(float, float)
public java.awt.geom.Rectangle2D.Double getBoundingBox(float userRotation,
float userZoom)
userRotation - rotation factor specified by the user under which the
page will be rotated.userZoom - zoom factor specified by the user under which the page will
be rotated.
public java.awt.geom.Rectangle2D.Double getBoundingBox(int boundary,
float userRotation,
float userZoom)
boundary - boundary constant to specify which boundary to respect when
calculating the page's size.userRotation - rotation factor specified by the user under which the
page will be rotated.userZoom - zoom factor specified by the user under which the page will
be rotated.
public PRectangle getPageBoundary(int specifiedBox)
specifiedBox - page boundary constant
public java.lang.String toString()
toString in class Dictionarypublic float getTotalRotation(float userRotation)
userRotation - rotation factor to be applied to page
public java.util.ArrayList<Annotation> getAnnotations()
public java.lang.String[] getDecodedContentSteam()
public java.awt.geom.Rectangle2D.Float getMediaBox()
public java.awt.geom.Rectangle2D.Float getCropBox()
public java.awt.geom.Rectangle2D.Float getArtBox()
public java.awt.geom.Rectangle2D.Float getBleedBox()
public java.awt.geom.Rectangle2D.Float getTrimBox()
public PageText getViewText()
public PageText getText()
public java.util.Vector getImages()
public Resources getResources()
public void reduceMemory()
reduceMemory in interface MemoryManageablepublic void addPaintPageListener(PaintPageListener listener)
public void removePaintPageListener(PaintPageListener listener)
public void notifyPaintPageListeners()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||