com.qoppa.pdfProcess
Class PDFPage

java.lang.Object
  extended bycom.qoppa.pdfViewer.hiObjects.AbstractPDFPage
      extended bycom.qoppa.pdfProcess.PDFPage
All Implemented Interfaces:
IPDFPage

public class PDFPage
extends AbstractPDFPage
implements IPDFPage

This class holds a page in a PDF document.

Author:
Qoppa Software

Field Summary
static int COMPRESSION_DEFLATE
           
static int COMPRESSION_JBIG2
           
static int COMPRESSION_JPEG
           
 
Method Summary
 void addAnnotation(Annotation annot)
          Adds a new annotation to this page.
 void addJPEGImage(File jpegFile, int x, int y, AffineTransform xform)
          Adds a JPEG image onto this page.
 SignatureField addSignatureField(String fieldName, Rectangle2D bounds)
          Adds a signature field to this page.
 void appendPageContent(PDFPage srcPage, double x, double y, double scaleX, double scaleY)
          Adds the content of another page to this page.
 Annotation copyAnnotation(Annotation annot)
          Use this method to copy annotations onto this page, from this or other documents.
 Graphics2D createGraphics()
          Creates a Graphics2D object to draw into this page.
 Graphics2D createGraphics(Layer layer)
          Creates a graphics object that encapsulates a layer in a PDF document.
 void deleteAnnotations()
          Delete all annotations from the page.
 void drawImage(Image image, int dstX, int dstY, Color bgndColor, AffineTransform xform, ImageParam params)
          Draws an image onto this page.
 void drawImage(Image image, int dstX, int dstY, int dstWidth, int dstHeight, Color bgndColor, AffineTransform xform, ImageParam params)
          Draws an image onto this page.
 void drawText(String str, Font font, Paint textPaint, double x, double y, AffineTransform xform)
          Draws text onto this page.
 void fillShape(Shape shape, Paint shapePaint, double offsetX, double offsetY, AffineTransform xform)
          Fills a shape on this page.
 Vector findText(String searchText, boolean caseSensitive, boolean wholeWords)
          Searches the page for text and returns a list of TextPosition objects for each of the occurrences of the string in the page.
 void flattenAnnotation(Annotation annot)
          Flatten the given annotation.
 void flattenAnnotations(boolean paintNonPrintableAnnots)
          Flattens the annotations.
 void flattenWidget(Widget widget)
          Flatten a widget into the content layer of the page.
 Vector getAnnotations()
          Returns a list of PDF annotations in this page.
 Rectangle2D getArtBox()
          Return this page's Art Box.
 Rectangle2D getBleedBox()
          Return this page's Bleed Box.
 Rectangle2D getCropBox()
          Returns the PDF page's 'CropBox'.
 double getDisplayHeight()
          Returns the display height of this page in 72 DPI.
 double getDisplayWidth()
          Returns the display width of this page in 72 DPI.
 double getDisplayX()
          Returns the page's left margin.
 double getDisplayY()
          Returns the page's top margin.
 PDFDocument getDocument()
          Returns the document that this page belongs to.
 BufferedImage getImage()
          Returns a BufferedImage containing a rendering of the page at the default PDF resolution: 72 DPI.
 BufferedImage getImage(int dpi)
          Returns a BufferedImage containing a rendering of the page at the given resolution in DPI.
 Rectangle2D getMediaBox()
          Returns the PDF page's 'MediaBox'.
 int getPageIndex()
          Gets the page index of this page within the document.
 int getPageRotation()
          Returns the rotation of this page in degrees.
 double getPaperHeight()
          Returns the paper's height of this page in 72 DPI.
 double getPaperWidth()
          Returns the paper's width of this page in 72 DPI.
 BufferedImage getSubImage(Rectangle2D pageArea, int dpi)
          Returns an image for part of the page.
 String getTabbingOrder()
          Returns the tabbing order as defined in the page description, if present.
 Rectangle2D getTrimBox()
          Return this page's Trim Box.
 void invalidate()
          Invalidate paint cache.
 boolean isEmpty()
          Check whether the page is empty.
 void prependPageContent(PDFPage srcPage, double x, double y, double scaleX, double scaleY)
          Prepend the contents of another page to this page.
 void removeAnnotation(Annotation annot)
          Removes an annotation from this page.
 void savePageAsGIF(OutputStream outStream, int dpi)
          Render the page as an image and save it to the output stream in PNG format.
 void savePageAsJPEG(OutputStream outStream, int dpi, float quality)
          Render the page as an image and save it to the output stream in JPEG format.
 void savePageAsPNG(OutputStream outStream, int dpi)
          Render the page as an image and save it to the output stream in PNG format.
 void savePageAsTIFF(OutputStream outStream, double resDPI, String tiffCompression)
          Save the rendering image of the page to the given OutputStream in TIFF format.
 void savePageAsTIFF(OutputStream outStream, TIFFOptions options)
          Render the page to an image and save it in TIFF format to the given OutputStream.
 void setArtBox(Rectangle2D rect)
          Sets this page's Art Box.
 void setBleedBox(Rectangle2D rect)
          Sets this page's Bleed Box.
 void setClip(Area newClip)
          Sets the clip area in the page's content stream when drawing to the page.
 void setCropBox(Rectangle2D rect)
          Sets the PDF page's 'CropBox'.
 void setPageRotation(int degrees)
          Changes this page's rotation.
 void setTrimBox(Rectangle2D rect)
          Sets this page's Trim Box.
 void strokeShape(Shape shape, Paint shapePaint, double offsetX, double offsetY, AffineTransform xform)
          Draws the outline of a shape on this page.
 String useGradientPaint(GradientPaint paint)
           
 String useGState(double strokeAlpha, double fillAlpha, String blendName)
           
 void writeAnnotsAsXFDF(nanoxml.XMLElement topElement, Integer pageIndex)
          Internal do not use
 
Methods inherited from class com.qoppa.pdfViewer.hiObjects.AbstractPDFPage
findLinesContainingText, findTextWithContext, getImage, getShapes, getTextSelection, paintPage, paintPage, printPage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.qoppa.pdf.dom.IPDFPage
findTextWithContext, getImage, getTextSelection, paintPage, printPage
 

Field Detail

COMPRESSION_JPEG

public static final int COMPRESSION_JPEG
See Also:
Constant Field Values

COMPRESSION_DEFLATE

public static final int COMPRESSION_DEFLATE
See Also:
Constant Field Values

COMPRESSION_JBIG2

public static final int COMPRESSION_JBIG2
See Also:
Constant Field Values
Method Detail

isEmpty

public boolean isEmpty()
                throws PDFException
Check whether the page is empty. An empty page is a page without any commands on it.

Returns:
true if the page is empty, false otherwise.
Throws:
PDFException

getAnnotations

public Vector getAnnotations()
                      throws PDFException
Returns a list of PDF annotations in this page. This vector is a clone of the actual annotations vector any changes made to this vector will not affect the actual vector. However annotations contained in the vector can be edited. The objects in the Vector are all derived from com.qoppa.pdf.annotations.Annotation.

Specified by:
getAnnotations in interface IPDFPage
Returns:
List of annotations.
Throws:
PDFException

createGraphics

public Graphics2D createGraphics()
                          throws PDFException
Creates a Graphics2D object to draw into this page. Anything drawn to this graphics object will be drawn onto the PDF page and can then be saved into a PDF document or printed. New content will be drawn on top of the current page content.

The Graphics2D object will initially have its origin on the upper left corner of the page's crop box (the visible area of the page).

Returns:
Graphics2D Graphics object used to draw into this page.
Throws:
PDFException

createGraphics

public Graphics2D createGraphics(Layer layer)
                          throws PDFException
Creates a graphics object that encapsulates a layer in a PDF document. When drawing to this graphics object, all elements will be drawn into a new layer (optional content group) in the pdf document.

The Graphics2D object will initially have its origin on the upper left corner of the page's crop box (the visible area of the page).

Parameters:
layer - The layer to draw into. This object must be created through PDFDocument.addLayer()
Returns:
A Graphics2D object that can be drawn into.
Throws:
PDFException

getCropBox

public Rectangle2D getCropBox()
Returns the PDF page's 'CropBox'. The CropBox is a rectangle that is used to crop content before displaying or printing the page. This rectangle is in PDF native coordinates starting at the bottom left and increasing up to the right.

Specified by:
getCropBox in interface IPDFPage
Returns:
Rectangle2D This page's CropBox

getImage

public BufferedImage getImage()
                       throws PDFException
Returns a BufferedImage containing a rendering of the page at the default PDF resolution: 72 DPI.

Throws:
PDFException

getImage

public BufferedImage getImage(int dpi)
                       throws PDFException
Returns a BufferedImage containing a rendering of the page at the given resolution in DPI.

Parameters:
dpi - Dots per inch at which to render the image.
Returns:
A BufferedImage object of the page at the requested DPI.
Throws:
PDFException

getSubImage

public BufferedImage getSubImage(Rectangle2D pageArea,
                                 int dpi)
                          throws PDFException
Returns an image for part of the page. The section of the page to get the image for is specified in a rectangle, the resolution of the image is given in the dpi argument.

Parameters:
pageArea - The area of the page to get an image for.
dpi - The desired resolution for the image.
Returns:
A BufferedImage object of the section of the page requested.
Throws:
PDFException

savePageAsJPEG

public void savePageAsJPEG(OutputStream outStream,
                           int dpi,
                           float quality)
                    throws IOException,
                           PDFException
Render the page as an image and save it to the output stream in JPEG format.

Parameters:
outStream - The stream to save the image to.
dpi - Dots per inch at which to render the image. 72 is the native PDF resolution.
quality - The quality setting to use for JPEG compression. The range for this value is 0.0 to 1.0. Lower values mean higher compression and lower quality. As a guideline, 0.25 is low quality, 0.5 is medium quality and 0.75 is high quality.
Throws:
IOException
PDFException

savePageAsPNG

public void savePageAsPNG(OutputStream outStream,
                          int dpi)
                   throws PDFException,
                          IOException
Render the page as an image and save it to the output stream in PNG format.

Parameters:
outStream - The stream to save the image to.
dpi - Dots per inch at which to render the image. 72 is the native PDF resolution.
Throws:
PDFException
IOException

savePageAsGIF

public void savePageAsGIF(OutputStream outStream,
                          int dpi)
                   throws PDFException,
                          IOException
Render the page as an image and save it to the output stream in PNG format.

Parameters:
outStream - The stream to save the image to.
dpi - Dots per inch at which to render the image. 72 is the native PDF resolution.
Throws:
PDFException
IOException

savePageAsTIFF

public void savePageAsTIFF(OutputStream outStream,
                           double resDPI,
                           String tiffCompression)
                    throws IOException,
                           PDFException
Save the rendering image of the page to the given OutputStream in TIFF format. The image will be converted to black and white and fax compression will be used. resDPI is the resolution in DPI used to render the page, 72 is the recommended value for the resolution.
This method requires Java Advanced Imaging (JAI) classes in the class path (jai_codec.jar). See our documentation regarding Distribution and JAR Files for more info.

Parameters:
outStream - The stream to save the image to.
resDPI - Dots per inch at which to render the image.
tiffCompression - The type of TIFF compression to use. This value needs to be one of these predefined values:

TIFFCompressionTIFF_DEFLATE - Deflate lossless compression (Zip-in-TIFF)
TIFFCompressionTIFF_CCITT_RLE - CCITT Modified Huffman RLE
TIFFCompressionTIFF_CCITT_T4 - CCITT Group 3 fax encoding
TIFFCompressionTIFF_CCITT_T6 - CCITT Group 4 fax encoding
TIFFCompressionTIFF_JPEG - JPEG-in-TIFF compression.
TIFFCompressionTIFF_LZW - LZW Compression
TIFFCompressionTIFF_PACKBITS - Byte-oriented run-length encoding "PackBits" compression.
TIFFCompressionTIFF_ZLIB - ZLib Compression.
TIFFCompressionTIFF_NO_COMPRESSION - No compression.
Throws:
IOException
PDFException

savePageAsTIFF

public void savePageAsTIFF(OutputStream outStream,
                           TIFFOptions options)
                    throws IOException,
                           PDFException
Render the page to an image and save it in TIFF format to the given OutputStream. If fax compression is used, the image will be converted automatically to black and white.
This method requires Java Advanced Imaging (JAI) classes in the class path (jai_codec.jar). See our documentation regarding Distribution and JAR Files for more info.

Parameters:
outStream - The stream to save the image to.
options - Options when saving the image, such as the output DPI, the TIFF compression method and more.
Throws:
IOException
PDFException

getMediaBox

public Rectangle2D getMediaBox()
Returns the PDF page's 'MediaBox'. The MediaBox is a rectangle that defines the size of the Media that this page was designed for, this roughly corresponds to the page size when printing.

Specified by:
getMediaBox in interface IPDFPage
Returns:
Rectangle2D This page's MediaBox

getPaperHeight

public double getPaperHeight()
Returns the paper's height of this page in 72 DPI. This values comes from the page's MediaBox.

Returns:
double Height of this page

getPaperWidth

public double getPaperWidth()
Returns the paper's width of this page in 72 DPI. This values comes from the page's MediaBox.

Returns:
double Width of this page

getDisplayWidth

public double getDisplayWidth()
Returns the display width of this page in 72 DPI. This value comes from the pages CropBox

Specified by:
getDisplayWidth in interface IPDFPage
Returns:
double Width of this page

getDisplayHeight

public double getDisplayHeight()
Returns the display height of this page in 72 DPI. This value comes from the pages CropBox

Specified by:
getDisplayHeight in interface IPDFPage
Returns:
double Width of this page

getDisplayX

public double getDisplayX()
Description copied from interface: IPDFPage
Returns the page's left margin. This value correspond to the different between the page's CropBox X coordinate and the MediaBox X coordinate. When the page is, this will be the origin of the displayed page.

Specified by:
getDisplayX in interface IPDFPage
Returns:
The page's display X coordinate.

getDisplayY

public double getDisplayY()
Description copied from interface: IPDFPage
Returns the page's top margin. This value correspond to the different between the page's CropBox Y coordinate and the MediaBox Y coordinate. When the page is, this will be the origin of the displayed page.

Specified by:
getDisplayY in interface IPDFPage
Returns:
The page's display Y coordinate.

getPageRotation

public int getPageRotation()
Returns the rotation of this page in degrees.

Specified by:
getPageRotation in interface IPDFPage
Returns:
int Page rotation in degrees.

setPageRotation

public void setPageRotation(int degrees)
Changes this page's rotation.

Parameters:
degrees - The new page rotation, in degrees

getDocument

public PDFDocument getDocument()
Returns the document that this page belongs to. A PDFPage can only belong to a single document at a time.

Returns:
The parent document.

invalidate

public void invalidate()
Invalidate paint cache.


addSignatureField

public SignatureField addSignatureField(String fieldName,
                                        Rectangle2D bounds)
                                 throws PDFException
Adds a signature field to this page. The signature field is added to the page but is NOT signed. To sign the document, the application must call PDFDocument.signDocument. To create an invisible signature field, the bound rectangle should be set to (0,0,0,0) for the bounds.

Parameters:
fieldName - The name of the new field.
bounds - The bounds of the field on the page. (0,0,0,0) indicates that the signature field will be invisible.
Throws:
PDFException

copyAnnotation

public Annotation copyAnnotation(Annotation annot)
                          throws PDFException
Use this method to copy annotations onto this page, from this or other documents. The method will clone the annotation and then add it to this page.

Returns:
The new annotation.
Throws:
PDFException

addAnnotation

public void addAnnotation(Annotation annot)
                   throws PDFException
Adds a new annotation to this page. This method should only be used with annotations that have been newly created using the AnnotationFactory. It should not be used with existing annotations from this documetn or from other documents. To do this, use the copyAnnotation method.

Parameters:
annot - The annotation to add.
Throws:
PDFException

getPageIndex

public int getPageIndex()
Gets the page index of this page within the document. Page index starts at 0.

Specified by:
getPageIndex in interface IPDFPage
Returns:
int This page's index

removeAnnotation

public void removeAnnotation(Annotation annot)
                      throws PDFException
Removes an annotation from this page.

Parameters:
annot - A reference to the annotation that needs to be removed.
Throws:
PDFException

drawImage

public void drawImage(Image image,
                      int dstX,
                      int dstY,
                      Color bgndColor,
                      AffineTransform xform,
                      ImageParam params)
               throws PDFException
Draws an image onto this page. The image will be drawn at the specified dstX, dstY location and will not be scaled except for any transform passed into the method.

Parameters:
image - The image to draw.
dstX - The horizontal position of the image in 72 DPI.
dstY - The vertical position of the image in 72 DPI.
bgndColor - The background color if any. If this parameter is not null, the method will first fill a rectangle with this color where the image will be drawn, then draw the image on top.
xform - A transform to apply to the image before drawing it to the page. This parameter can be left null for no transform.
params - An ImageParam object describing what compression to use when writing images to the PDF document. If null, the library will use default settings.
Throws:
PDFException

drawImage

public void drawImage(Image image,
                      int dstX,
                      int dstY,
                      int dstWidth,
                      int dstHeight,
                      Color bgndColor,
                      AffineTransform xform,
                      ImageParam params)
               throws PDFException
Draws an image onto this page. The image will be scaled to dstWidth and dstHeight. If dstWidth or dstHeight are set to 0, the method will get the destination width and/or height from the image size.

Parameters:
image - The image to draw.
dstX - The horizontal position of the image in 72 DPI.
dstY - The vertical position of the image in 72 DPI.
dstWidth - The width on the page that the image will occupy. If this is <= 0, the method will use the image's width.
dstHeight - The height on the page that the image will occupy. If this is <= 0, the method will use the image's height.
bgndColor - The background color if any. If this parameter is not null, the method will first fill a rectangle with this color where the image will be drawn, then draw the image on top.
xform - A transform to apply to the image before drawing it to the page. This parameter can be left null for no transform.
params - An ImageParam object describing what compression to use when writing images to the PDF document. If null, the library will use default settings.
Throws:
PDFException

addJPEGImage

public void addJPEGImage(File jpegFile,
                         int x,
                         int y,
                         AffineTransform xform)
                  throws PDFException,
                         IOException
Adds a JPEG image onto this page.

Parameters:
jpegFile - The JPEG file.
x - The horizontal position of the image in 72 DPI.
y - The vertical position of the image in 72 DPI.
xform - A transform to apply to the image before drawing it to the page. This parameter can be left null for no transform.
Throws:
PDFException
IOException

appendPageContent

public void appendPageContent(PDFPage srcPage,
                              double x,
                              double y,
                              double scaleX,
                              double scaleY)
                       throws PDFException
Adds the content of another page to this page. This method takes the content stream and directly appends it to this page, without doing any processing. If x and y are set to 0, the source page will be aligned with the destination so that the upper left corners coincide.

Parameters:
srcPage - The source page to take the content stream from.
x - The X position on the destination page at which the upper left corner of the source page will be placed
y - The Y position on the destination page at which the upper left corner of the source page will be placed
scaleX - Horizontal scale to apply to the source page before adding it to the destination page. The scale is 1 based, 1 = full scale.
scaleY - Vertical scale to apply to the source page before adding it to the destination page. The scale is 1 based, 1 = full scale.
Throws:
PDFException

prependPageContent

public void prependPageContent(PDFPage srcPage,
                               double x,
                               double y,
                               double scaleX,
                               double scaleY)
                        throws PDFException
Prepend the contents of another page to this page. This method takes the content stream and adds it directly before the current page's content. This will have the effect of adding the content underneath the current content. If x and y are set to 0, the upper left corners of the two pages will coincide.

Parameters:
srcPage - The source page to take the content stream from.
x - The X position on the destination page at which the upper left corner of the source page will be placed
y - The Y position on the destination page at which the upper left corner of the source page will be placed
scaleX - Horizontal scale to apply to the source page before adding it to the destination page.
scaleY - Vertical scale to apply to the source page before adding it to the destination page.
Throws:
PDFException

fillShape

public void fillShape(Shape shape,
                      Paint shapePaint,
                      double offsetX,
                      double offsetY,
                      AffineTransform xform)
Fills a shape on this page.

Parameters:
shape - The shape to fill.
shapePaint - The color to use when filling the shape.
offsetX - A horizontal offset to apply before drawing the shape, in 72 DPI.
offsetY - A vertical offset to apply before drawing teh shape, in 72 DPI.
xform - A transform to apply to the shape before drawing it to the page.

flattenAnnotation

public void flattenAnnotation(Annotation annot)
                       throws PDFException
Flatten the given annotation. This makes the annotation uneditable and merges the content of the annotation with the page.

Parameters:
annot - The annotation to flatten into the content layer.
Throws:
PDFException

flattenAnnotations

public void flattenAnnotations(boolean paintNonPrintableAnnots)
                        throws PDFException
Flattens the annotations. This makes the annotations uneditable and merges the content of the annotations with the page. Even though technically, links, widgets (text fields, buttons, etc) and file attachments are annotations, this method does not delete them as they are not annotations in the logical sense. To delete these, the application needs to call the removeAnnotation() method with the annotation as an argument.

Parameters:
paintNonPrintableAnnots - Flag to indicate whether non-printable annotations should be painted or not.
Throws:
PDFException

deleteAnnotations

public void deleteAnnotations()
                       throws PDFException
Delete all annotations from the page. This removes all the annotations in the PDF page. Even though technically, links, widgets (text fields, buttons, etc) and file attachments are annotations, this method does flatten them as they are not annotations in the logical sense.

Throws:
PDFException

flattenWidget

public void flattenWidget(Widget widget)
                   throws PDFException
Flatten a widget into the content layer of the page. After flattening the widget, the widget is removed from the list of widgets in the page.

Parameters:
widget - The widget to flatten
Throws:
PDFException

strokeShape

public void strokeShape(Shape shape,
                        Paint shapePaint,
                        double offsetX,
                        double offsetY,
                        AffineTransform xform)
Draws the outline of a shape on this page.

Parameters:
shape - The shape whose outline will be drawn.
shapePaint - The color to use when drawing the outline of the shape.
offsetX - A horizontal offset to apply before drawing the shape, in 72 DPI.
offsetY - A vertical offset to apply before drawing teh shape, in 72 DPI.
xform - A transform to apply to the shape before drawing it to the page.

drawText

public void drawText(String str,
                     Font font,
                     Paint textPaint,
                     double x,
                     double y,
                     AffineTransform xform)
              throws PDFException
Draws text onto this page.

Parameters:
str - The string to draw on the page.
font - The font to use when drawing the text.
textPaint - The color to use when drawing the text.
x - The horizontal position of the text on the page, in 72 DPI.
y - The vertical position of the text on the page, in 72 DPI.
xform - A transform to apply to the text before drawing it to the page.
Throws:
PDFException

getBleedBox

public Rectangle2D getBleedBox()
Return this page's Bleed Box. A page should be clipped to this coordinates when output to a production environment. jPDFProcess does not use the Bleed Box, it uses the Crop Box to clip a page before printing. The method is provided for information to the host application. This rectangle is in PDF native coordinates starting at the bottom left and increasing up to the right.

Specified by:
getBleedBox in interface IPDFPage
Returns:
The page's bleed box.

getTrimBox

public Rectangle2D getTrimBox()
Return this page's Trim Box. The trim box defines a finished page's intended dimension after trimming. jPDFProcess does not use the Trim Box, the method is provided here for information to the host application. This rectangle is in PDF native coordinates starting at the bottom left and increasing up to the right.

Specified by:
getTrimBox in interface IPDFPage
Returns:
The page's crop box.

getArtBox

public Rectangle2D getArtBox()
Return this page's Art Box. The art box defines the extent of the page's meaningful content (including potential whitespace). jPDFViewer does not use the Art Box, the method is provided here for information to the host application. This rectangle is in PDF native coordinates starting at the bottom left and increasing up to the right.

Specified by:
getArtBox in interface IPDFPage
Returns:
The page's art box.

setCropBox

public void setCropBox(Rectangle2D rect)
                throws PDFException
Sets the PDF page's 'CropBox'. The CropBox is a rectangle that is used to crop content before displaying or printing the page. This rectangle is in PDF native coordinates starting at the bottom left and increasing up to the right.

Throws:
PDFException

setBleedBox

public void setBleedBox(Rectangle2D rect)
Sets this page's Bleed Box. A page should be clipped to this coordinates when output to a production environment. This rectangle is in PDF native coordinates starting at the bottom left and increasing up to the right.


setTrimBox

public void setTrimBox(Rectangle2D rect)
Sets this page's Trim Box. The trim box defines a finished page's intended dimension after trimming. This rectangle is in PDF native coordinates starting at the bottom left and increasing up to the right.


setArtBox

public void setArtBox(Rectangle2D rect)
Sets this page's Art Box. The art box defines the extent of the page's meaningful content (including potential whitespace). This rectangle is in PDF native coordinates starting at the bottom left and increasing up to the right.


writeAnnotsAsXFDF

public void writeAnnotsAsXFDF(nanoxml.XMLElement topElement,
                              Integer pageIndex)
                       throws PDFException
Internal do not use

Throws:
PDFException

useGradientPaint

public String useGradientPaint(GradientPaint paint)
                        throws PDFException
Throws:
PDFException

useGState

public String useGState(double strokeAlpha,
                        double fillAlpha,
                        String blendName)
                 throws PDFException
Throws:
PDFException

setClip

public void setClip(Area newClip)
             throws PDFException
Sets the clip area in the page's content stream when drawing to the page.

Parameters:
newClip - The new clip area.
Throws:
PDFException

findText

public Vector findText(String searchText,
                       boolean caseSensitive,
                       boolean wholeWords)
                throws PDFException
Searches the page for text and returns a list of TextPosition objects for each of the occurrences of the string in the page. If there are no occurrences, the method returns a Vector of length 0.

Specified by:
findText in interface IPDFPage
Parameters:
searchText - The text to search for.
caseSensitive - Flag indicating whether the search should be case sensitive.
wholeWords - Flag indicating whether the search should only look at whole words.
Returns:
A list of TextPosition objects.
Throws:
PDFException

getTabbingOrder

public String getTabbingOrder()
Returns the tabbing order as defined in the page description, if present. The tabbing order is used by viewers to determine the tabbing between form fields. The possible values are R for row order, C for column order and S for structure order.

Specified by:
getTabbingOrder in interface IPDFPage
Returns:
A string that holds the entry for the tabbing order from the page description.