Java Doc for PDFPage.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
   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

Field Summary
final public static  intINVERTEDPORTRAIT
     Specifies that the page is in INVERTEDPORTRAIT orientation.
final public static  intLANDSCAPE
     Specifies that the page is in LANDSCAPE orientation.
final public static  RectangleMEDIA_11x17
     Rectangle defining a page in 11x17 format.
final public static  RectangleMEDIA_a0
     Rectangle defining a page in a0 format.
final public static  RectangleMEDIA_a1
     Rectangle defining a page in a1 format.
final public static  RectangleMEDIA_a10
     Rectangle defining a page in a10 format.
final public static  RectangleMEDIA_a2
     Rectangle defining a page in a2 format.
final public static  RectangleMEDIA_a3
     Rectangle defining a page in a3 format.
final public static  RectangleMEDIA_a4
     Rectangle defining a page in a4 format.
final public static  RectangleMEDIA_a5
     Rectangle defining a page in a5 format.
final public static  RectangleMEDIA_a6
     Rectangle defining a page in a6 format.
final public static  RectangleMEDIA_a7
     Rectangle defining a page in a7 format.
final public static  RectangleMEDIA_a8
     Rectangle defining a page in a8 format.
final public static  RectangleMEDIA_a9
     Rectangle defining a page in a9 format.
final public static  RectangleMEDIA_archA
     Rectangle defining a page in archA format.
final public static  RectangleMEDIA_archB
     Rectangle defining a page in archB format.
final public static  RectangleMEDIA_archC
     Rectangle defining a page in archC format.
final public static  RectangleMEDIA_archD
     Rectangle defining a page in archD format.
final public static  RectangleMEDIA_archE
     Rectangle defining a page in archE format.
final public static  RectangleMEDIA_b0
     Rectangle defining a page in b0 format.
final public static  RectangleMEDIA_b1
     Rectangle defining a page in b1 format.
final public static  RectangleMEDIA_b2
     Rectangle defining a page in b2 format.
final public static  RectangleMEDIA_b3
     Rectangle defining a page in b3 format.
final public static  RectangleMEDIA_b4
     Rectangle defining a page in b4 format.
final public static  RectangleMEDIA_b5
     Rectangle defining a page in b5 format.
final public static  RectangleMEDIA_flsa
     Rectangle defining a page in flsa format.
final public static  RectangleMEDIA_flse
     Rectangle defining a page in flse format.
final public static  RectangleMEDIA_halfletter
     Rectangle defining a page in halfletter format.
final public static  RectangleMEDIA_ledger
     Rectangle defining a page in ledger format.
final public static  RectangleMEDIA_legal
     Rectangle defining a page in legal format.
final public static  RectangleMEDIA_letter
     Rectangle defining a page in letter format.
final public static  RectangleMEDIA_note
     Rectangle defining a page in note format.
final public static  intPORTRAIT
     Specifies that the page is in PORTRAIT orientation.
final public static  intSEASCAPE
     Specifies that the page is in SEASCAPE orientation.
protected  Vectorannotations
     This holds any Annotations contained within this page.
protected  Vectorcontents
     This holds the contents of the page.
protected  Vectorfonts
    
protected  booleanhasImageBhasImageChasImageI
     These handle the procset for this page.
protected  Rectanglemediabox
    
protected  PDFObjectpdfPageList
     This is the pages object id that this page belongs to.
protected  procsetprocset
    
protected  Vectorresources
    
protected  introtate
     Specifies the number of degrees the page should be rotated clockwise when it is displayed.
protected  PDFObjectthumbnail
     Object ID that contains a thumbnail sketch of the page.

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  voidadd(PDFObject ob)
     This adds an object that describes some content to this page.
public  voidaddAnnotation(PDFObject ob)
     This adds an Annotation to the page.
public  PDFAnnotaddLink(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  PDFAnnotaddLink(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  PDFAnnotaddNote(String note, int x, int y, int w, int h)
     This 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  voidaddResource(String resource)
     This adds a resource to the page.
public  voidaddToProcset(String proc)
    
public  voidaddXObject(String inxobject)
     This adds an XObject resource to the page.
public  intcx(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  intcy(int x, int y)
     This utility method converts the y coordinate from Java to User space within the page.
public  DimensiongetDimension()
    
public  PDFFontgetFont(String type, String font, int style)
     Returns a PDFFont, creating it if not yet used.
public  PDFGraphicsgetGraphics()
     This returns a PDFGraphics object, which can then be used to render on to this page.
public  RectanglegetMedia()
     Returns the page's media.
public  intgetOrientation()
    
public  voidsetMedia(Rectangle mediabox)
     Sets the media size for this page.
public  voidsetOrientation(int rotate)
     Sets the page's orientation.
public  voidsetThumbnail(PDFObject thumbnail)
     This adds an object that describes a thumbnail for this page.
public  voidwrite(OutputStream os)
    

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



rotate
protected int rotate(Code)
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:   PDFPage.PORTRAIT
See Also:   PDFPage.LANDSCAPE
See Also:   PDFPage.INVERTEDPORTRAIT
See Also:   PDFPage.SEASCAPE



thumbnail
protected PDFObject thumbnail(Code)
Object ID that contains a thumbnail sketch of the page. -1 indicates no thumbnail.




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



PDFPage
public PDFPage(int rotate)(Code)
Constructs a page using A4 media, but using the supplied orientation.
Parameters:
  rotate - Rotation: 0, 90, 180 or 270
See Also:   PDFPage.PORTRAIT
See Also:   PDFPage.LANDSCAPE
See Also:   PDFPage.INVERTEDPORTRAIT
See Also:   PDFPage.SEASCAPE



PDFPage
public PDFPage(Rectangle mediabox, int rotate)(Code)
Constructs a page using the supplied media size and orientation.
Parameters:
  mediabox - Rectangle describing the page size
Parameters:
  rotate - Rotation: 0, 90, 180 or 270
See Also:   PDFPage.PORTRAIT
See Also:   PDFPage.LANDSCAPE
See Also:   PDFPage.INVERTEDPORTRAIT
See Also:   PDFPage.SEASCAPE




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



addToProcset
public void addToProcset(String proc)(Code)



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



getDimension
public Dimension getDimension()(Code)



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)



getOrientation
public int getOrientation()(Code)
Returns the pages orientation
See Also:   PDFPage.PORTRAIT
See Also:   PDFPage.LANDSCAPE
See Also:   PDFPage.INVERTEDPORTRAIT
See Also:   PDFPage.SEASCAPE current rotation of the page



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




write
public void write(OutputStream os) throws IOException(Code)

Parameters:
  os - OutputStream to send the object to
exception:
  IOException - on error



Fields inherited from gnu.jpdf.PDFObject
protected int objser(Code)(Java Doc)
protected PDFDocument pdfDocument(Code)(Java Doc)

Methods inherited from gnu.jpdf.PDFObject
final public PDFDocument getPDFDocument()(Code)(Java Doc)
final public int getSerialID()(Code)(Java Doc)
public String getType()(Code)(Java Doc)
public static String toArray(Vector v)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
abstract public void write(OutputStream os) throws IOException(Code)(Java Doc)
final public void writeEnd(OutputStream os) throws IOException(Code)(Java Doc)
final public void writeStart(OutputStream os) throws IOException(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.