Java Doc for PDFJob.java in  » PDF » gnujpdf » gnu » jpdf » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » gnujpdf » gnu.jpdf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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 $

Inner Class :class graphic extends PDFGraphics implements PrintGraphics

Field Summary
protected transient  OutputStreamos
     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.
protected  PDFPagepage
    
protected  intpagenum
    
protected  PDFDocumentpdfDocument
    

Constructor Summary
public  PDFJob()
    

This constructs the job.

public  PDFJob(OutputStream os)
    

This constructs the job.

public  PDFJob(OutputStream os, String title)
    

This constructs the job.


Method Summary
public  PDFAnnotaddNote(String note, int x, int y, int w, int h)
     Convenience method: Adds a text note to the document.
public  PDFOutlineaddOutline(String title)
    

This method attaches an outline to the current page being generated.

public  PDFOutlineaddOutline(String title, int x, int y, int w, int h)
    

This method attaches an outline to the current page being generated.

public  voidend()
    
public  PDFPagegetCurrentPage()
    

Returns the current PDFPage being worked on.

public  intgetCurrentPageNumber()
    

Returns the current page number.

public  GraphicsgetGraphics(int orient)
    

This returns a graphics object that can be used to draw on a page.

public  GraphicsgetGraphics()
    

This returns a graphics object that can be used to draw on a page.

public  PDFDocumentgetPDFDocument()
     Returns the PDFDocument object for this document.
public  DimensiongetPageDimension()
    
public  intgetPageResolution()
     This returns the page resolution.
public  booleanlastPageFirst()
    

In AWT's PrintJob, this would return true if the user requested that the file is printed in reverse order.


Field Detail
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




Constructor Detail
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




Method Detail
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(int orient)(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.


Parameters:
  orient - - the int Orientation of the new page, as defined in PDFPage Graphics object to draw.
See Also:   gnu.jpdf.PDFPage.PORTRAIT
See Also:   gnu.jpdf.PDFPage.LANDSCAPE
See Also:   gnu.jpdf.PDFPage.INVERTEDPORTRAIT
See Also:   gnu.jpdf.PDFPage.SEASCAPE



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



Methods inherited from java.awt.PrintJob
abstract public void end()(Code)(Java Doc)
public void finalize()(Code)(Java Doc)
abstract public Graphics getGraphics()(Code)(Java Doc)
abstract public Dimension getPageDimension()(Code)(Java Doc)
abstract public int getPageResolution()(Code)(Java Doc)
abstract public boolean lastPageFirst()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.