Main Page | Namespace List | Class Hierarchy | Class List | Class Members | Related Pages

gnu::jpdf::PDFPage Class Reference

Inheritance diagram for gnu::jpdf::PDFPage:

Inheritance graph
[legend]
Collaboration diagram for gnu::jpdf::PDFPage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PDFPage ()
 PDFPage (Rectangle mediabox)
 PDFPage (int rotate)
 PDFPage (Rectangle mediabox, int rotate)
void addToProcset (String proc)
PDFGraphics getGraphics ()
PDFFont getFont (String type, String font, int style)
void setMedia (Rectangle mediabox)
Rectangle getMedia ()
Dimension getDimension ()
void setOrientation (int rotate)
int getOrientation ()
void add (PDFObject ob)
void addAnnotation (PDFObject ob)
PDFAnnot addNote (String note, int x, int y, int w, int h)
PDFAnnot addLink (int x, int y, int w, int h, PDFObject dest)
PDFAnnot addLink (int x, int y, int w, int h, PDFObject dest, int vx, int vy, int vw, int vh)
void addXObject (String inxobject)
void addResource (String resource)
void addImageResource (String resource)
void setThumbnail (PDFObject thumbnail)
PDFOutline addOutline (String title)
PDFOutline addOutline (String title, int x, int y, int w, int h)
void write (OutputStream os) throws IOException
int cy (int x, int y)
int cx (int x, int y)
int[] cxy (int x, int y)

Static Public Attributes

final int PORTRAIT = 0
final int LANDSCAPE = 90
final int INVERTEDPORTRAIT = 180
final int SEASCAPE = 270
final Rectangle MEDIA_letter = new Rectangle(0,0,612,792)
final Rectangle MEDIA_note = new Rectangle(0,0,540,720)
final Rectangle MEDIA_legal = new Rectangle(0,0,612,1008)
final Rectangle MEDIA_a0 = new Rectangle(0,0,2380,3368)
final Rectangle MEDIA_a1 = new Rectangle(0,0,1684,2380)
final Rectangle MEDIA_a2 = new Rectangle(0,0,1190,1684)
final Rectangle MEDIA_a3 = new Rectangle(0,0,842,1190)
final Rectangle MEDIA_a4 = new Rectangle(0,0,595,842)
final Rectangle MEDIA_a5 = new Rectangle(0,0,421,595)
final Rectangle MEDIA_a6 = new Rectangle(0,0,297,421)
final Rectangle MEDIA_a7 = new Rectangle(0,0,210,297)
final Rectangle MEDIA_a8 = new Rectangle(0,0,148,210)
final Rectangle MEDIA_a9 = new Rectangle(0,0,105,148)
final Rectangle MEDIA_a10 = new Rectangle(0,0,74,105)
final Rectangle MEDIA_b0 = new Rectangle(0,0,2836,4008)
final Rectangle MEDIA_b1 = new Rectangle(0,0,2004,2836)
final Rectangle MEDIA_b2 = new Rectangle(0,0,1418,2004)
final Rectangle MEDIA_b3 = new Rectangle(0,0,1002,1418)
final Rectangle MEDIA_b4 = new Rectangle(0,0,709,1002)
final Rectangle MEDIA_b5 = new Rectangle(0,0,501,709)
final Rectangle MEDIA_archE = new Rectangle(0,0,2592,3456)
final Rectangle MEDIA_archD = new Rectangle(0,0,1728,2592)
final Rectangle MEDIA_archC = new Rectangle(0,0,1296,1728)
final Rectangle MEDIA_archB = new Rectangle(0,0,864,1296)
final Rectangle MEDIA_archA = new Rectangle(0,0,648,864)
final Rectangle MEDIA_flsa = new Rectangle(0,0,612,936)
final Rectangle MEDIA_flse = new Rectangle(0,0,612,936)
final Rectangle MEDIA_halfletter = new Rectangle(0,0,396,612)
final Rectangle MEDIA_11x17 = new Rectangle(0,0,792,1224)
final Rectangle MEDIA_ledger = new Rectangle(0,0,1224,792)

Protected Attributes

Rectangle mediabox
PDFObject pdfPageList
Vector contents
int rotate
PDFObject thumbnail
Vector annotations
Vector resources
Vector imageResources
Vector fonts
boolean hasImageB
boolean hasImageC
boolean hasImageI
procset procset

Detailed Description

This class defines a single page within a document. It is linked to a single PDFGraphics object

Author:
Peter T Mount

Eric Z. Beard, ericzbeard@hotmail.com

Author
ezb
Version:
Revision
1.3
,
Date
2002/03/04 20:33:18


Constructor & Destructor Documentation

gnu::jpdf::PDFPage::PDFPage  )  [inline]
 

This constructs a Page object, which will hold any contents for this page.

Once created, it is added to the document via the PDF.add() method. (For Advanced use, via the PDFPages.add() method).

This defaults to a4 media.

gnu::jpdf::PDFPage::PDFPage Rectangle  mediabox  )  [inline]
 

Constructs a page, using the supplied media size.

Parameters:
mediabox Rectangle describing the page size

gnu::jpdf::PDFPage::PDFPage int  rotate  )  [inline]
 

Constructs a page using A4 media, but using the supplied orientation.

Parameters:
rotate Rotation: 0, 90, 180 or 270
See also:
PORTRAIT

LANDSCAPE

INVERTEDPORTRAIT

SEASCAPE

gnu::jpdf::PDFPage::PDFPage Rectangle  mediabox,
int  rotate
[inline]
 

Constructs a page using the supplied media size and orientation.

Parameters:
mediabox Rectangle describing the page size
rotate Rotation: 0, 90, 180 or 270
See also:
PORTRAIT

LANDSCAPE

INVERTEDPORTRAIT

SEASCAPE


Member Function Documentation

void gnu::jpdf::PDFPage::add PDFObject  ob  )  [inline]
 

This adds an object that describes some content to this page.

Note: Objects that describe contents must be added using this method _AFTER_ the PDF.add() method has been called.

Parameters:
ob PDFObject describing some contents

void gnu::jpdf::PDFPage::addAnnotation PDFObject  ob  )  [inline]
 

This adds an Annotation to the page.

As with other objects, the annotation must be added to the pdf document using PDF.add() before adding to the page.

Parameters:
ob Annotation to add.

PDFAnnot gnu::jpdf::PDFPage::addLink int  x,
int  y,
int  w,
int  h,
PDFObject  dest,
int  vx,
int  vy,
int  vw,
int  vh
[inline]
 

Adds a hyperlink to the document.

Parameters:
x Coordinate of active area
y Coordinate of active area
w Width of the active area
h Height of the active area
dest Page that will be displayed when the link is activated
vx Coordinate of what part of the page should be displayed
vy Coordinate of what part of the page should be displayed
vw Width of the what part of the page should be displayed
vh Height of the what part of the page should be displayed (defined in Java coordinates). If this is null, then the page is fitted to the display.
Returns:
Returns the annotation, so other settings can be changed.

PDFAnnot gnu::jpdf::PDFPage::addLink int  x,
int  y,
int  w,
int  h,
PDFObject  dest
[inline]
 

Adds a hyperlink to the document.

Parameters:
x Coordinate of active area
y Coordinate of active area
w Width of the active area
h Height of the active area
dest Page that will be displayed when the link is activated. When displayed, the zoom factor will be changed to fit the display.
Returns:
Returns the annotation, so other settings can be changed.

PDFAnnot gnu::jpdf::PDFPage::addNote String  note,
int  x,
int  y,
int  w,
int  h
[inline]
 

This method adds a text note to the document.

Parameters:
note Text of the note
x Coordinate of note
y Coordinate of note
w Width of the note
h Height of the note
Returns:
Returns the annotation, so other settings can be changed.

PDFOutline gnu::jpdf::PDFPage::addOutline String  title,
int  x,
int  y,
int  w,
int  h
[inline]
 

This method attaches an outline to the current page being generated. When selected, the outline displays the top of the page.

Note: If the outline is not in the top level (ie below another outline) then it must not be passed to this method.

Parameters:
title Outline title to attach
x int coordinate of region
y int coordinate of region
w int coordinate of region
h int coordinate of region
Returns:
PDFOutline object created, for addSubOutline if required.

PDFOutline gnu::jpdf::PDFPage::addOutline String  title  )  [inline]
 

This method attaches an outline to the current page being generated. When selected, the outline displays the top of the page.

Parameters:
title Outline title to attach
Returns:
PDFOutline object created, for addSubOutline if required.

void gnu::jpdf::PDFPage::addResource String  resource  )  [inline]
 

This adds a resource to the page.

Parameters:
resource String defining the resource

void gnu::jpdf::PDFPage::addXObject String  inxobject  )  [inline]
 

This adds an XObject resource to the page. The string should be of the format /Name ObjectNumber RevisionNumber R as in /Image1 13 0 R .

int gnu::jpdf::PDFPage::cx int  x,
int  y
[inline]
 

This utility method converts the y coordinate from Java to User space within the page.

Parameters:
y Coordinate in Java space
Returns:
y Coordinate in User space

int [] gnu::jpdf::PDFPage::cxy int  x,
int  y
[inline]
 

This utility method converts the Java coordinates to User space within the page.

Parameters:
x Coordinate in Java space
y Coordinate in Java space
Returns:
array containing the x & y Coordinate in User space

int gnu::jpdf::PDFPage::cy int  x,
int  y
[inline]
 

This utility method converts the y coordinate from Java to User space within the page.

Parameters:
y Coordinate in Java space
Returns:
y Coordinate in User space

PDFFont gnu::jpdf::PDFPage::getFont String  type,
String  font,
int  style
[inline]
 

Returns a PDFFont, creating it if not yet used.

Parameters:
type Font type, usually /Type1
font Font name
style java.awt.Font style, ie Font.NORMAL

PDFGraphics gnu::jpdf::PDFPage::getGraphics  )  [inline]
 

This returns a PDFGraphics object, which can then be used to render on to this page. If a previous PDFGraphics object was used, this object is appended to the page, and will be drawn over the top of any previous objects.

Rectangle gnu::jpdf::PDFPage::getMedia  )  [inline]
 

Returns the page's media.

Returns:
Rectangle describing the page size in device units (72dpi)

int gnu::jpdf::PDFPage::getOrientation  )  [inline]
 

Returns the pages orientation

See also:
PORTRAIT

LANDSCAPE

INVERTEDPORTRAIT

SEASCAPE

Returns:
current rotation of the page

void gnu::jpdf::PDFPage::setMedia Rectangle  mediabox  )  [inline]
 

Sets the media size for this page.

Normally, this should be done when the page is created, to avoid problems.

Parameters:
mediabox Rectangle describing the page size

void gnu::jpdf::PDFPage::setOrientation int  rotate  )  [inline]
 

Sets the page's orientation.

Normally, this should be done when the page is created, to avoid problems.

Parameters:
rotate Rotation: 0, 90, 180 or 270

void gnu::jpdf::PDFPage::setThumbnail PDFObject  thumbnail  )  [inline]
 

This adds an object that describes a thumbnail for this page.

Note: The object must already exist in the PDF, as only the object ID is stored.

Parameters:
thumbnail PDFObject containing the thumbnail

void gnu::jpdf::PDFPage::write OutputStream  os  )  throws IOException [inline, virtual]
 

Parameters:
os OutputStream to send the object to
Exceptions:
IOException on error

Implements gnu::jpdf::PDFObject.


Member Data Documentation

Vector gnu::jpdf::PDFPage::annotations [protected]
 

This holds any Annotations contained within this page.

Vector gnu::jpdf::PDFPage::contents [protected]
 

This holds the contents of the page.

Vector gnu::jpdf::PDFPage::fonts [protected]
 

The fonts associated with this page

boolean gnu::jpdf::PDFPage::hasImageB [protected]
 

These handle the procset for this page. Refer to page 140 of the PDF Reference manual NB: Text is handled when the fonts Vector is null, and a font is created refer to getFont() to see where it's defined

boolean gnu::jpdf::PDFPage::hasImageC [protected]
 

These handle the procset for this page. Refer to page 140 of the PDF Reference manual NB: Text is handled when the fonts Vector is null, and a font is created refer to getFont() to see where it's defined

boolean gnu::jpdf::PDFPage::hasImageI [protected]
 

These handle the procset for this page. Refer to page 140 of the PDF Reference manual NB: Text is handled when the fonts Vector is null, and a font is created refer to getFont() to see where it's defined

final int gnu::jpdf::PDFPage::INVERTEDPORTRAIT = 180 [static]
 

Specifies that the page is in INVERTEDPORTRAIT orientation.

final int gnu::jpdf::PDFPage::LANDSCAPE = 90 [static]
 

Specifies that the page is in LANDSCAPE orientation.

final Rectangle gnu::jpdf::PDFPage::MEDIA_11x17 = new Rectangle(0,0,792,1224) [static]
 

Rectangle defining a page in 11x17 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a0 = new Rectangle(0,0,2380,3368) [static]
 

Rectangle defining a page in a0 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a1 = new Rectangle(0,0,1684,2380) [static]
 

Rectangle defining a page in a1 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a10 = new Rectangle(0,0,74,105) [static]
 

Rectangle defining a page in a10 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a2 = new Rectangle(0,0,1190,1684) [static]
 

Rectangle defining a page in a2 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a3 = new Rectangle(0,0,842,1190) [static]
 

Rectangle defining a page in a3 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a4 = new Rectangle(0,0,595,842) [static]
 

Rectangle defining a page in a4 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a5 = new Rectangle(0,0,421,595) [static]
 

Rectangle defining a page in a5 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a6 = new Rectangle(0,0,297,421) [static]
 

Rectangle defining a page in a6 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a7 = new Rectangle(0,0,210,297) [static]
 

Rectangle defining a page in a7 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a8 = new Rectangle(0,0,148,210) [static]
 

Rectangle defining a page in a8 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_a9 = new Rectangle(0,0,105,148) [static]
 

Rectangle defining a page in a9 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_archA = new Rectangle(0,0,648,864) [static]
 

Rectangle defining a page in archA format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_archB = new Rectangle(0,0,864,1296) [static]
 

Rectangle defining a page in archB format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_archC = new Rectangle(0,0,1296,1728) [static]
 

Rectangle defining a page in archC format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_archD = new Rectangle(0,0,1728,2592) [static]
 

Rectangle defining a page in archD format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_archE = new Rectangle(0,0,2592,3456) [static]
 

Rectangle defining a page in archE format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_b0 = new Rectangle(0,0,2836,4008) [static]
 

Rectangle defining a page in b0 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_b1 = new Rectangle(0,0,2004,2836) [static]
 

Rectangle defining a page in b1 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_b2 = new Rectangle(0,0,1418,2004) [static]
 

Rectangle defining a page in b2 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_b3 = new Rectangle(0,0,1002,1418) [static]
 

Rectangle defining a page in b3 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_b4 = new Rectangle(0,0,709,1002) [static]
 

Rectangle defining a page in b4 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_b5 = new Rectangle(0,0,501,709) [static]
 

Rectangle defining a page in b5 format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_flsa = new Rectangle(0,0,612,936) [static]
 

Rectangle defining a page in flsa format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_flse = new Rectangle(0,0,612,936) [static]
 

Rectangle defining a page in flse format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_halfletter = new Rectangle(0,0,396,612) [static]
 

Rectangle defining a page in halfletter format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_ledger = new Rectangle(0,0,1224,792) [static]
 

Rectangle defining a page in ledger format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_legal = new Rectangle(0,0,612,1008) [static]
 

Rectangle defining a page in legal format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_letter = new Rectangle(0,0,612,792) [static]
 

Rectangle defining a page in letter format.

final Rectangle gnu::jpdf::PDFPage::MEDIA_note = new Rectangle(0,0,540,720) [static]
 

Rectangle defining a page in note format.

Rectangle gnu::jpdf::PDFPage::mediabox [protected]
 

This is this pages media box, ie the size of the page

PDFObject gnu::jpdf::PDFPage::pdfPageList [protected]
 

This is the pages object id that this page belongs to. It is set by the pages object when it is added to it.

final int gnu::jpdf::PDFPage::PORTRAIT = 0 [static]
 

Specifies that the page is in PORTRAIT orientation.

Vector gnu::jpdf::PDFPage::resources [protected]
 

This holds any resources for this page

int gnu::jpdf::PDFPage::rotate [protected]
 

Specifies the number of degrees the page should be rotated clockwise when it is displayed. This value must be zero (the default), or a multiple of 90.

See also:
PORTRAIT

LANDSCAPE

INVERTEDPORTRAIT

SEASCAPE

final int gnu::jpdf::PDFPage::SEASCAPE = 270 [static]
 

Specifies that the page is in SEASCAPE orientation.

PDFObject gnu::jpdf::PDFPage::thumbnail [protected]
 

Object ID that contains a thumbnail sketch of the page. -1 indicates no thumbnail.


The documentation for this class was generated from the following file:
Generated on Wed Jan 19 16:58:08 2005 by  doxygen 1.3.9.1