ElegantJ PDF Library Java API Specification v1.1

com.elegantj.pdf
Class Page

java.lang.Object
  extended bycom.elegantj.pdf.PDFObject
      extended bycom.elegantj.pdf.Page
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
PDFGraphics.PDFPage

public class Page
extends PDFObject
implements java.lang.Cloneable

A Page object that describes a single page of PDF document containing text, graphics and images


Field Summary
static int ROTATE_0
          Specifies that the page is in Default Rotation
static int ROTATE_180
          Specifies that the page is in 180 degree clock wise rotation
static int ROTATE_270
          Specifies that the page is in 270 degree clock wise rotation
static int ROTATE_90
          Specifies that the page is in 90 degree clock wise rotation
 
Constructor Summary
Page(Pages pages)
          This constructs a Page object with default media size of A4
Page(Pages pages, int rotate)
          Constructs a Page object using default A4 size media box, and using the specified rotation
Page(Pages pages, MediaBox mediabox)
          Constructs a page, using the specified media size.
Page(Pages pages, MediaBox mediabox, int rotate)
          Constructs a page using the specified media size and rotation
 
Method Summary
 void addAnnotation(PDFAnnotation ob)
          Method which adds the PDFAnnotation objects to this page The two types of PDFAnnotation objects are PDFTextAnnotation, PDFLinkAnnotation
 void addGraphics(PDFGraphicsObject ob)
          Method which adds the PDFGraphicsObject object to this page The graphics objects include PDFText, PDFRectangle, PDFLine, PDFCircle, PDFArc, PDFOval, PDFPolygon
 void addImage(PDFImage pImage)
          Method which adds the PDFImage object to this page
 void addTable(PDFTable pdfTable)
          Method which adds the PDFTable object to this page
 java.lang.String addText(PDFText text)
          Adds the PDFText to the Page
 java.awt.Shape getClip()
          Returns the clip shape
 MediaBox getMedia()
          Method which returns this page's media box
 int getPageIndex()
          Returns the page no associated with this page
 Pages getParent()
          Method which returns the parent of this page
 int getRotation()
          Returns this page's rotation angle
 void setClip(int x, int y, int width, int height)
          Sets the current clip to the rectangle specified by the given coordinates
 void setClip(java.awt.Shape clip)
          Sets the current clipping area to an arbitrary clip shape
 void setMedia(MediaBox mediabox)
          Method which sets the media box for this page This should be done when the page is created
 void setRotation(int rotate)
          Sets this page's rotation angle
 
Methods inherited from class com.elegantj.pdf.PDFObject
getPDFObjectID, getPDFObjectRefStr, getPDFObjectType, setPDFObjectID, setPDFObjectType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROTATE_0

public static final int ROTATE_0
Specifies that the page is in Default Rotation

See Also:
Constant Field Values

ROTATE_90

public static final int ROTATE_90
Specifies that the page is in 90 degree clock wise rotation

See Also:
Constant Field Values

ROTATE_180

public static final int ROTATE_180
Specifies that the page is in 180 degree clock wise rotation

See Also:
Constant Field Values

ROTATE_270

public static final int ROTATE_270
Specifies that the page is in 270 degree clock wise rotation

See Also:
Constant Field Values
Constructor Detail

Page

public Page(Pages pages)
This constructs a Page object with default media size of A4


Page

public Page(Pages pages,
            MediaBox mediabox)
Constructs a page, using the specified media size.

Parameters:
mediabox - The media box describing the page size

Page

public Page(Pages pages,
            int rotate)
Constructs a Page object using default A4 size media box, and using the specified rotation

Parameters:
rotate - The rotation angle, possible values are 0, 90, 180 or 270

Page

public Page(Pages pages,
            MediaBox mediabox,
            int rotate)
Constructs a page using the specified media size and rotation

Parameters:
mediabox - The media box describing the page size
rotate - The rotation angle, possible values are 0, 90, 180 or 270
Method Detail

setMedia

public void setMedia(MediaBox mediabox)
Method which sets the media box for this page This should be done when the page is created

Parameters:
mediabox - The media box describing the page size

getParent

public Pages getParent()
Method which returns the parent of this page

Returns:
The parent of this page

getMedia

public MediaBox getMedia()
Method which returns this page's media box

Returns:
The mediabox describing the page size

setRotation

public void setRotation(int rotate)
Sets this page's rotation angle

Parameters:
rotate - The rotation angle, Possible values are : 0, 90, 180 or 270

getRotation

public int getRotation()
Returns this page's rotation angle

Returns:
This page's rotation angle

addTable

public void addTable(PDFTable pdfTable)
              throws java.io.IOException
Method which adds the PDFTable object to this page

Parameters:
pdfTable - The PDFTable object which will be added to this page
Throws:
java.io.IOException

addGraphics

public void addGraphics(PDFGraphicsObject ob)
                 throws java.io.IOException
Method which adds the PDFGraphicsObject object to this page The graphics objects include PDFText, PDFRectangle, PDFLine, PDFCircle, PDFArc, PDFOval, PDFPolygon

Parameters:
ob - The specified PDFGraphicsObject
Throws:
java.io.IOException

addText

public java.lang.String addText(PDFText text)
                         throws java.io.IOException
Adds the PDFText to the Page

Parameters:
text - The PDFText
Returns:
string The overflowed text The overflowed text means it returns the text which not adjusted to the specified PDFText coordinates
Throws:
java.io.IOException

addImage

public void addImage(PDFImage pImage)
Method which adds the PDFImage object to this page

Parameters:
pImage - The specified image

addAnnotation

public void addAnnotation(PDFAnnotation ob)
Method which adds the PDFAnnotation objects to this page The two types of PDFAnnotation objects are PDFTextAnnotation, PDFLinkAnnotation

Parameters:
ob - The PDFAnnotation object to add to this page

setClip

public void setClip(int x,
                    int y,
                    int width,
                    int height)
Sets the current clip to the rectangle specified by the given coordinates

Parameters:
x - The x coordinate of the new clip rectangle
y - The y coordinate of the new clip rectangle
width - The width of the new clip rectangle
height - The height of the new clip rectangle

setClip

public void setClip(java.awt.Shape clip)
Sets the current clipping area to an arbitrary clip shape

Parameters:
clip - The Shape to use to set the clip

getClip

public java.awt.Shape getClip()
Returns the clip shape

Returns:
The clip shape

getPageIndex

public int getPageIndex()
Returns the page no associated with this page

Returns:
The page no associated with this page

ElegantJ PDF Library Java API Specification v1.1

For any feedback, suggestion, or query, please revert back to support@elegantjpdf.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjpdf.com
All Rights Reserved.