| java.lang.Object java.awt.PrintJob gnu.jpdf.PDFJob
PDFJob | public class PDFJob extends PrintJob implements Serializable(Code) | | This class extends awt's PrintJob, to provide a simple method of writing
PDF documents.
You can use this with any code that uses Java's printing mechanism. It
does include a few extra methods to provide access to some of PDF's features
like annotations, or outlines.
author: Peter T Mount, http://www.retep.org.uk/pdf/ author: Eric Z. Beard, ericzbeard@hotmail.com author: $Author: ezb $ version: $Revision: 1.2 $, $Date: 2001/11/15 20:18:11 $ |
os | protected transient OutputStream os(Code) | | This is the OutputStream the PDF file will be written to when complete
Note: This is transient, as it's not valid after being Serialized.
|
page | protected PDFPage page(Code) | | This is the current page being constructed by the last getGraphics()
call
|
pagenum | protected int pagenum(Code) | | This is the page number of the current page
|
pdfDocument | protected PDFDocument pdfDocument(Code) | | This is the PDF file being constructed
|
PDFJob | public PDFJob()(Code) | | This constructs the job. This method must be used when creating a
template pdf file, ie one that is Serialised by one application, and
then restored by another.
ezb 20011115 - Haven't done anything with templates yet, don't know
how/if they are implemented
|
PDFJob | public PDFJob(OutputStream os)(Code) | | This constructs the job. This is the primary constructor that
will be used for creating pdf documents with this package. The
specified output stream is a handle to the .pdf file you wish to
create.
Parameters: os - - OutputStream to use for the pdf output |
PDFJob | public PDFJob(OutputStream os, String title)(Code) | | This constructs the job. This is the primary constructor that
will be used for creating pdf documents with this package. The
specified output stream is a handle to the .pdf file you wish to
create.
Use this constructor if you want to give the pdf document a name
other than the default of "PDF Doc"
Parameters: os - - OutputStream to use for the pdf output Parameters: title - a String value |
addNote | public PDFAnnot addNote(String note, int x, int y, int w, int h)(Code) | | Convenience 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 - a String , the title of the Outline a PDFOutline object that was created, for adding sub-outline's 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 specified region.
Parameters: title - Outline title to attach Parameters: x - Left coordinate of region Parameters: y - Top coordinate of region Parameters: w - width of region Parameters: h - height of region the PDFOutline object created, for adding sub-outline's if required. |
end | public void end()(Code) | | This writes the PDF document to the OutputStream, finishing the
document.
|
getCurrentPage | public PDFPage getCurrentPage()(Code) | | Returns the current PDFPage being worked on. Useful for working on
Annotations (like links), etc.
the PDFPage currently being constructed |
getCurrentPageNumber | public int getCurrentPageNumber()(Code) | | Returns the current page number.
Useful if you need to include one in the document
the int current page number |
getGraphics | public Graphics getGraphics()(Code) | | This returns a graphics object that can be used to draw on a page.
In PDF, this will be a new page within the document.
This new page will by default be oriented as a portrait
a Graphics object to draw to. |
getPDFDocument | public PDFDocument getPDFDocument()(Code) | | Returns the PDFDocument object for this document.
Useful for gaining access to
the internals of PDFDocument.
the PDF object |
getPageDimension | public Dimension getPageDimension()(Code) | | Returns the page dimension
a Dimension instance, the size of the page |
getPageResolution | public int getPageResolution()(Code) | | This returns the page resolution.
This is the PDF (and Postscript) device resolution of 72 dpi
(equivalent to 1 point).
an int , the resolution in pixels per inch |
lastPageFirst | public boolean lastPageFirst()(Code) | | In AWT's PrintJob, this would return true if the user requested that the
file is printed in reverse order. For PDF's this is not applicable, so
it will always return false.
false |
|
|