| java.lang.Object gnu.jpdf.PDFObject gnu.jpdf.PDFPage
PDFPage | public class PDFPage extends PDFObject implements Serializable(Code) | | This class defines a single page within a document. It is linked to a
single PDFGraphics object
author: Peter T Mount author: Eric Z. Beard, ericzbeard@hotmail.com author: $Author: ezb $ version: $Revision: 1.3 $, $Date: 2002/03/04 20:33:18 $ |
Inner Class :public class procset extends PDFObject | |
Constructor Summary | |
public | PDFPage() This constructs a Page object, which will hold any contents for this
page. | public | PDFPage(Rectangle mediabox) Constructs a page, using the supplied media size. | public | PDFPage(int rotate) Constructs a page using A4 media, but using the supplied orientation. | public | PDFPage(Rectangle mediabox, int rotate) Constructs a page using the supplied media size and orientation. |
Method Summary | |
public void | add(PDFObject ob) This adds an object that describes some content to this page. | public void | addAnnotation(PDFObject ob) This adds an Annotation to the page. | public PDFAnnot | addLink(int x, int y, int w, int h, PDFObject dest) Adds a hyperlink to the document.
Parameters: x - Coordinate of active area Parameters: y - Coordinate of active area Parameters: w - Width of the active area Parameters: h - Height of the active area Parameters: dest - Page that will be displayed when the link is activated. | public PDFAnnot | addLink(int x, int y, int w, int h, PDFObject dest, int vx, int vy, int vw, int vh) Adds a hyperlink to the document.
Parameters: x - Coordinate of active area Parameters: y - Coordinate of active area Parameters: w - Width of the active area Parameters: h - Height of the active area Parameters: dest - Page that will be displayed when the link is activated Parameters: view - Rectangle defining what part of the page should be displayed(defined in Java coordinates). | public PDFAnnot | addNote(String note, int x, int y, int w, int h) This method adds a text note to the document. | public PDFOutline | addOutline(String title) This method attaches an outline to the current page being generated. | public PDFOutline | addOutline(String title, int x, int y, int w, int h) This method attaches an outline to the current page being generated. | public void | addResource(String resource) This adds a resource to the page. | public void | addToProcset(String proc) | public void | addXObject(String inxobject) This adds an XObject resource to the page. | public int | cx(int x, int y) This utility method converts the y coordinate from Java to User space
within the page. | public int[] | cxy(int x, int y) This utility method converts the Java coordinates to User space
within the page. | public int | cy(int x, int y) This utility method converts the y coordinate from Java to User space
within the page. | public Dimension | getDimension() | public PDFFont | getFont(String type, String font, int style) Returns a PDFFont, creating it if not yet used. | public PDFGraphics | getGraphics() This returns a PDFGraphics object, which can then be used to render
on to this page. | public Rectangle | getMedia() Returns the page's media. | public int | getOrientation() | public void | setMedia(Rectangle mediabox) Sets the media size for this page. | public void | setOrientation(int rotate) Sets the page's orientation. | public void | setThumbnail(PDFObject thumbnail) This adds an object that describes a thumbnail for this page. | public void | write(OutputStream os) |
INVERTEDPORTRAIT | final public static int INVERTEDPORTRAIT(Code) | | Specifies that the page is in INVERTEDPORTRAIT orientation.
|
LANDSCAPE | final public static int LANDSCAPE(Code) | | Specifies that the page is in LANDSCAPE orientation.
|
MEDIA_11x17 | final public static Rectangle MEDIA_11x17(Code) | | Rectangle defining a page in 11x17 format.
|
MEDIA_a0 | final public static Rectangle MEDIA_a0(Code) | | Rectangle defining a page in a0 format.
|
MEDIA_a1 | final public static Rectangle MEDIA_a1(Code) | | Rectangle defining a page in a1 format.
|
MEDIA_a10 | final public static Rectangle MEDIA_a10(Code) | | Rectangle defining a page in a10 format.
|
MEDIA_a2 | final public static Rectangle MEDIA_a2(Code) | | Rectangle defining a page in a2 format.
|
MEDIA_a3 | final public static Rectangle MEDIA_a3(Code) | | Rectangle defining a page in a3 format.
|
MEDIA_a4 | final public static Rectangle MEDIA_a4(Code) | | Rectangle defining a page in a4 format.
|
MEDIA_a5 | final public static Rectangle MEDIA_a5(Code) | | Rectangle defining a page in a5 format.
|
MEDIA_a6 | final public static Rectangle MEDIA_a6(Code) | | Rectangle defining a page in a6 format.
|
MEDIA_a7 | final public static Rectangle MEDIA_a7(Code) | | Rectangle defining a page in a7 format.
|
MEDIA_a8 | final public static Rectangle MEDIA_a8(Code) | | Rectangle defining a page in a8 format.
|
MEDIA_a9 | final public static Rectangle MEDIA_a9(Code) | | Rectangle defining a page in a9 format.
|
MEDIA_archA | final public static Rectangle MEDIA_archA(Code) | | Rectangle defining a page in archA format.
|
MEDIA_archB | final public static Rectangle MEDIA_archB(Code) | | Rectangle defining a page in archB format.
|
MEDIA_archC | final public static Rectangle MEDIA_archC(Code) | | Rectangle defining a page in archC format.
|
MEDIA_archD | final public static Rectangle MEDIA_archD(Code) | | Rectangle defining a page in archD format.
|
MEDIA_archE | final public static Rectangle MEDIA_archE(Code) | | Rectangle defining a page in archE format.
|
MEDIA_b0 | final public static Rectangle MEDIA_b0(Code) | | Rectangle defining a page in b0 format.
|
MEDIA_b1 | final public static Rectangle MEDIA_b1(Code) | | Rectangle defining a page in b1 format.
|
MEDIA_b2 | final public static Rectangle MEDIA_b2(Code) | | Rectangle defining a page in b2 format.
|
MEDIA_b3 | final public static Rectangle MEDIA_b3(Code) | | Rectangle defining a page in b3 format.
|
MEDIA_b4 | final public static Rectangle MEDIA_b4(Code) | | Rectangle defining a page in b4 format.
|
MEDIA_b5 | final public static Rectangle MEDIA_b5(Code) | | Rectangle defining a page in b5 format.
|
MEDIA_flsa | final public static Rectangle MEDIA_flsa(Code) | | Rectangle defining a page in flsa format.
|
MEDIA_flse | final public static Rectangle MEDIA_flse(Code) | | Rectangle defining a page in flse format.
|
MEDIA_halfletter | final public static Rectangle MEDIA_halfletter(Code) | | Rectangle defining a page in halfletter format.
|
MEDIA_ledger | final public static Rectangle MEDIA_ledger(Code) | | Rectangle defining a page in ledger format.
|
MEDIA_legal | final public static Rectangle MEDIA_legal(Code) | | Rectangle defining a page in legal format.
|
MEDIA_letter | final public static Rectangle MEDIA_letter(Code) | | Rectangle defining a page in letter format.
|
MEDIA_note | final public static Rectangle MEDIA_note(Code) | | Rectangle defining a page in note format.
|
PORTRAIT | final public static int PORTRAIT(Code) | | Specifies that the page is in PORTRAIT orientation.
|
SEASCAPE | final public static int SEASCAPE(Code) | | Specifies that the page is in SEASCAPE orientation.
|
annotations | protected Vector annotations(Code) | | This holds any Annotations contained within this page.
|
contents | protected Vector contents(Code) | | This holds the contents of the page.
|
fonts | protected Vector fonts(Code) | | The fonts associated with this page
|
hasImageBhasImageChasImageI | protected boolean hasImageBhasImageChasImageI(Code) | | 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
|
mediabox | protected Rectangle mediabox(Code) | | This is this pages media box, ie the size of the page
|
pdfPageList | protected PDFObject pdfPageList(Code) | | This is the pages object id that this page belongs to.
It is set by the pages object when it is added to it.
|
procset | protected procset procset(Code) | | |
resources | protected Vector resources(Code) | | This holds any resources for this page
|
thumbnail | protected PDFObject thumbnail(Code) | | Object ID that contains a thumbnail sketch of the page.
-1 indicates no thumbnail.
|
PDFPage | public PDFPage()(Code) | | 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.
|
PDFPage | public PDFPage(Rectangle mediabox)(Code) | | Constructs a page, using the supplied media size.
Parameters: mediabox - Rectangle describing the page size |
add | public void add(PDFObject ob)(Code) | | 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 |
addAnnotation | public void addAnnotation(PDFObject ob)(Code) | | 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. |
addLink | public PDFAnnot addLink(int x, int y, int w, int h, PDFObject dest)(Code) | | Adds a hyperlink to the document.
Parameters: x - Coordinate of active area Parameters: y - Coordinate of active area Parameters: w - Width of the active area Parameters: h - Height of the active area Parameters: dest - Page that will be displayed when the link is activated. Whendisplayed, the zoom factor will be changed to fit the display. Returns the annotation, so other settings can be changed. |
addLink | public PDFAnnot addLink(int x, int y, int w, int h, PDFObject dest, int vx, int vy, int vw, int vh)(Code) | | Adds a hyperlink to the document.
Parameters: x - Coordinate of active area Parameters: y - Coordinate of active area Parameters: w - Width of the active area Parameters: h - Height of the active area Parameters: dest - Page that will be displayed when the link is activated Parameters: view - Rectangle defining what part of the page should be displayed(defined in Java coordinates). If this is null, then the page is fitted tothe display. Returns the annotation, so other settings can be changed. |
addNote | public PDFAnnot addNote(String note, int x, int y, int w, int h)(Code) | | This method adds a text note to the document.
Parameters: note - Text of the note Parameters: x - Coordinate of note Parameters: y - Coordinate of note Parameters: w - Width of the note Parameters: h - Height of the note Returns the annotation, so other settings can be changed. |
addOutline | public PDFOutline addOutline(String title)(Code) | | 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 PDFOutline object created, for addSubOutline if required. |
addOutline | public PDFOutline addOutline(String title, int x, int y, int w, int h)(Code) | | 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 Parameters: l - Left coordinate of region Parameters: b - Bottom coordinate of region Parameters: r - Right coordinate of region Parameters: t - Top coordinate of region PDFOutline object created, for addSubOutline if required. |
addResource | public void addResource(String resource)(Code) | | This adds a resource to the page.
Parameters: resource - String defining the resource |
addXObject | public void addXObject(String inxobject)(Code) | | 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 .
|
cx | public int cx(int x, int y)(Code) | | This utility method converts the y coordinate from Java to User space
within the page.
Parameters: y - Coordinate in Java space y Coordinate in User space |
cxy | public int[] cxy(int x, int y)(Code) | | This utility method converts the Java coordinates to User space
within the page.
Parameters: x - Coordinate in Java space Parameters: y - Coordinate in Java space array containing the x & y Coordinate in User space |
cy | public int cy(int x, int y)(Code) | | This utility method converts the y coordinate from Java to User space
within the page.
Parameters: y - Coordinate in Java space y Coordinate in User space |
getFont | public PDFFont getFont(String type, String font, int style)(Code) | | Returns a PDFFont, creating it if not yet used.
Parameters: font - Font name Parameters: style - java.awt.Font style, ie Font.NORMAL |
getGraphics | public PDFGraphics getGraphics()(Code) | | 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.
|
getMedia | public Rectangle getMedia()(Code) | | Returns the page's media.
Rectangle describing the page size in device units (72dpi) |
setMedia | public void setMedia(Rectangle mediabox)(Code) | | 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 |
setOrientation | public void setOrientation(int rotate)(Code) | | 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 |
setThumbnail | public void setThumbnail(PDFObject thumbnail)(Code) | | 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 |
|
|