com.crionics.jpdf.creator
Class Page

java.lang.Object
  extended by PdfObjectContainer
      extended by com.crionics.jpdf.creator.AbstractCreatorObjects
          extended by com.crionics.jpdf.creator.Page

public class Page
extends AbstractCreatorObjects

The class is the object representation of a Pdf page.


Field Summary
static int ARTBOX
          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.
static int BLEEDBOX
          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.
static int CROPBOX
          A rectangle, expressed in default user space units, defining the visible region of default user space.
static int MEDIABOX
          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.
static int TRIMBOX
          A rectangle, expressed in default user space units, defining the intended dimensions of the finished page after trimming.
 
Method Summary
static Page createInstance(PdfDocument doc)
          Allows the creation of a new Page into the Specified document.
static Page createInstance(PdfDocument doc, int pageIndex)
          Allows the creation of a new Page into the Specified document at the requested position.
static Page createInstance(PdfDocument doc, java.awt.print.PageFormat pageFormat)
          Allows the creation of a new Page into the Specified document.
static Page createInstance(PdfDocument doc, java.awt.print.PageFormat pageFormat, int pageIndex)
          Allows the creation of a new Page into the Specified document.
 java.awt.geom.Rectangle2D getBox(int type)
          Recovers the dimensions of the specified Box.
 JPdfGraphics2D getGraphics()
          Returns the JPdfGraphics2D object: kind of a pencil to write on the page
 java.awt.print.PageFormat getPageFormat()
          Returns the page format.
 boolean hasBox(int type)
          Determines if the specified Box has been defined for the current page.
 boolean useColor(ColorSearchPreferences prefs, java.util.List colorsFound, boolean exitOnDiscovery)
          Determines if the page contains some colored elements.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARTBOX

public static final int ARTBOX
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. Default value: the value of CropBox.

See Also:
Constant Field Values

BLEEDBOX

public static final int BLEEDBOX
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. Default value: the value of CropBox.

See Also:
Constant Field Values

CROPBOX

public static final int CROPBOX
A rectangle, expressed in default user space units, defining the visible region of default user space. When the page is displayed or printed, its contents are to be clipped (cropped) to this rectangle and then imposed on the output medium in some implementationdefined manner. Default value: the value of MediaBox.

See Also:
Constant Field Values

MEDIABOX

public static final int MEDIABOX
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. Default value: None, this box is always present.

See Also:
Constant Field Values

TRIMBOX

public static final int TRIMBOX
A rectangle, expressed in default user space units, defining the intended dimensions of the finished page after trimming. Default value: the value of CropBox.

See Also:
Constant Field Values
Method Detail

createInstance

public static Page createInstance(PdfDocument doc)
                           throws PdfException,
                                  java.io.IOException
Allows the creation of a new Page into the Specified document.

The usage of this method requires the acquision of the Module jPDF Creator

Parameters:
doc - The Document into which the page should be created.
Returns:
The page created.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

createInstance

public static Page createInstance(PdfDocument doc,
                                  int pageIndex)
                           throws PdfException,
                                  java.io.IOException
Allows the creation of a new Page into the Specified document at the requested position.

The usage of this method requires the acquision of the Module jPDF Creator

Parameters:
doc - The Document into which the page should be created.
pageIndex - The index at which the page should be inserted (Indexes starts From 1).
Returns:
The page created.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

createInstance

public static Page createInstance(PdfDocument doc,
                                  java.awt.print.PageFormat pageFormat)
                           throws PdfException,
                                  java.io.IOException
Allows the creation of a new Page into the Specified document.

The usage of this method requires the acquision of the Module jPDF Creator

Parameters:
doc - The Document into which the page should be created.
pageFormat - The Page Format of the page to be created
Returns:
The page created.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

createInstance

public static Page createInstance(PdfDocument doc,
                                  java.awt.print.PageFormat pageFormat,
                                  int pageIndex)
                           throws PdfException,
                                  java.io.IOException
Allows the creation of a new Page into the Specified document.

The usage of this method requires the acquision of the Module jPDF Creator

Parameters:
doc - The Document into which the page should be created.
pageIndex - The index at which the page should be inserted (Indexes starts From 1).
pageFormat - The Page Format of the page to be created
Returns:
The page created.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getBox

public java.awt.geom.Rectangle2D getBox(int type)
                                 throws java.io.IOException,
                                        PdfException
Recovers the dimensions of the specified Box. Note: If the box does not exist, the dimensions of the default box will be returned in a recursive manner. Please review the default value of the Page.***BOX constants.

Parameters:
type - The Type of the box, one of the Page.***BOX constants.
Returns:
The dimension of the Box.
Throws:
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.

getGraphics

public JPdfGraphics2D getGraphics()
                           throws java.io.IOException,
                                  PdfException
Returns the JPdfGraphics2D object: kind of a pencil to write on the page

Returns:
a JPdfGraphics2D object which can be used to draw on the page
Throws:
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.

getPageFormat

public java.awt.print.PageFormat getPageFormat()
                                        throws PdfException,
                                               java.io.IOException
Returns the page format.

Returns:
the page format in page space
Throws:
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.

hasBox

public boolean hasBox(int type)
               throws java.io.IOException,
                      PdfException
Determines if the specified Box has been defined for the current page.

Parameters:
type - The Type of the box, one of the Page.***BOX constants.
Returns:
true if this is the case, false otherwise.
Throws:
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.

useColor

public boolean useColor(ColorSearchPreferences prefs,
                        java.util.List colorsFound,
                        boolean exitOnDiscovery)
                 throws java.io.IOException,
                        PdfException
Determines if the page contains some colored elements.

Parameters:
prefs - The Preferences used for the search. see ColorSearchPreferencesfor more informations.
colorsFound - A list which will be filled with all the colors found in the document, or null if this information is not required.
exitOnDiscovery - Set this value to true if you want the search to stop on the first occurence of a color, false otherwise.
Returns:
true if a color was found, false otherwise.
Throws:
java.io.IOException - Raised if a problem occured while reading the file.
PdfException - Raised if a problem occured while parsing the file.


Copyright © 1999-2007 Crionics. All Rights Reserved.