Java Doc for Pdf.java in  » PDF » pjx » com » etymon » pj » 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 » pjx » com.etymon.pj 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.etymon.pj.Pdf

Pdf
public class Pdf (Code)
A document representation of a PDF file.
author:
   Nassib Nassar


Field Summary
protected  PjObjectVector_objects
    
protected  Hashtable_trailer
    

Constructor Summary
public  Pdf()
     Creates an empty PDF document.
public  Pdf(String filename)
     Creates a PDF document from an existing PDF file.

Method Summary
public  voidaddToPage(PjPage page, int objectNumber)
     Adds a PjObject to a page in this PDF document.
public  intappendPage(int objectNumber)
     Appends a PjPage to the end of this PDF document.
Parameters:
  objectNumber - the object number of the PjPage to append.
public  voidappendPdfDocument(Pdf pdf)
     Appends the pages of a PDF document to this document.
public  intdeletePage(int pageNumber)
     Deletes a page in this document by page number.
public  intgetCatalog()
     Looks up the Catalog object in this document.
public  PjDictionarygetEncryptDictionary()
     Looks up the Encrypt dictionary within this document's trailer.
public  VectorgetFields()
    
public  PjReferencegetInfoDictionary()
     Looks up the Info dictionary within this document's trailer.
public  intgetMaxObjectNumber()
     Returns the largest object number in the list of registered PjObjects.
public  PjObjectgetObject(int objectNumber)
     Looks up a PjObject by its object number.
Parameters:
  objectNumber - the object number of the PjObject to retrieve.
public  intgetPage(int pageNumber)
     Looks up a page in this document by page number.
Parameters:
  pageNumber - the page number.
public  intgetPageCount()
     Determines the number of pages in this PDF document.
public  intgetRootPages()
     Looks up the root Pages object of this document's Pages tree.
public  PjDictionaryinheritFieldAttributes(PjDictionary node)
     Returns a clone of a field node such that all inherited attributes of the given field node are made explicit.
public  PjPagesNodeinheritPageAttributes(PjPagesNode node)
     Returns a clone of a pages node such that all inherited attributes of the given pages node are made explicit.
public  intregisterObject(PjObject obj)
     Registers a PjObject within this PDF document.
Parameters:
  obj - the PjObject to register.
public  voidregisterObject(PjObject obj, int objectNumber)
     Registers a PjObject within this PDF document using a specified object number.
public  PjObjectresolve(PjObject obj)
     Dereferences a PjObject if it is a PjReference.
Parameters:
  obj - the PjObject to dereference.
public  voidsetEncryptDictionary(PjReference ref)
     Sets the Encrypt dictionary within this document's trailer.
public  voidsetEncryptDictionary(PjDictionary dict)
     Sets the Encrypt dictionary within this document's trailer.
public  voidsetInfoDictionary(PjReference ref)
     Sets the Info dictionary within this document's trailer.
public  voidupdateFieldValue(PjDictionary origField, PjDictionary field, String value)
    
public  voidwriteToFile(String filename)
     Writes this PDF document to a file in PDF format.
public  voidwriteToStream(OutputStream os)
     Writes this PDF document to a stream in PDF format.

Field Detail
_objects
protected PjObjectVector _objects(Code)



_trailer
protected Hashtable _trailer(Code)




Constructor Detail
Pdf
public Pdf()(Code)
Creates an empty PDF document.



Pdf
public Pdf(String filename) throws IOException, PjException(Code)
Creates a PDF document from an existing PDF file.
Parameters:
  filename - the name of the PDF file to read.
exception:
  IOException - if an I/O error occurs.
exception:
  PjException - if a PDF error occurs.




Method Detail
addToPage
public void addToPage(PjPage page, int objectNumber) throws InvalidPdfObjectException(Code)
Adds a PjObject to a page in this PDF document.
Parameters:
  page - the page object to add to.
Parameters:
  objectNumber - the object number of the PjObject to add.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered.



appendPage
public int appendPage(int objectNumber)(Code)
Appends a PjPage to the end of this PDF document.
Parameters:
  objectNumber - the object number of the PjPage to append. the new object number of the appended PjPage.



appendPdfDocument
public void appendPdfDocument(Pdf pdf) throws InvalidPdfObjectException(Code)
Appends the pages of a PDF document to this document. Note that this does not clone the other document but simply includes references to its objects. Therefore the other document should be discarded immediately after a call to this method, otherwise you could get very strange results.
Parameters:
  pdf - the PDF document to append.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered in either document.



deletePage
public int deletePage(int pageNumber) throws IndexOutOfBoundsException, InvalidPdfObjectException(Code)
Deletes a page in this document by page number. The page is deleted by removing the reference to it from the page tree; however, no objects are actually deleted from the document.
Parameters:
  pageNumber - the page number. Pages are numberedstarting with 1. the object number of the deleted Page object.
exception:
  IndexOutOfBoundsException - if an invalid pagenumber was given.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered.



getCatalog
public int getCatalog() throws InvalidPdfObjectException(Code)
Looks up the Catalog object in this document. the object number of the Catalog object.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered.



getEncryptDictionary
public PjDictionary getEncryptDictionary() throws InvalidPdfObjectException(Code)
Looks up the Encrypt dictionary within this document's trailer. The Encrypt dictionary contains information for decrypting a document. the Encrypt dictionary, or null if no Encrypt field ispresent in the trailer.
exception:
  InvalidPdfObjectException - if the Encrypt field inthe trailer is not a dictionary (PjDictionary) object.



getFields
public Vector getFields() throws InvalidPdfObjectException(Code)



getInfoDictionary
public PjReference getInfoDictionary() throws InvalidPdfObjectException(Code)
Looks up the Info dictionary within this document's trailer. The Info dictionary contains general information about the document. a reference to the Info dictionary, or null if noInfo field is present in the trailer.
exception:
  InvalidPdfObjectException - if the Info field inthe trailer is not a reference (PjReference) object.



getMaxObjectNumber
public int getMaxObjectNumber()(Code)
Returns the largest object number in the list of registered PjObjects. This is useful mainly for functions that need to run through the list and process each object, because this provides the maximum object number they need to examine. The object number may not currently be assigned to an object, but probably was at some point in the past. the size of the object list.



getObject
public PjObject getObject(int objectNumber)(Code)
Looks up a PjObject by its object number.
Parameters:
  objectNumber - the object number of the PjObject to retrieve. the requested PjObject.



getPage
public int getPage(int pageNumber) throws IndexOutOfBoundsException, InvalidPdfObjectException(Code)
Looks up a page in this document by page number.
Parameters:
  pageNumber - the page number. Pages are numberedstarting with 1. the object number of the identified Page object.
exception:
  IndexOutOfBoundsException - if an invalid pagenumber was given.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered.



getPageCount
public int getPageCount() throws InvalidPdfObjectException(Code)
Determines the number of pages in this PDF document. the number of pages in this PDF document.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered.



getRootPages
public int getRootPages() throws InvalidPdfObjectException(Code)
Looks up the root Pages object of this document's Pages tree. the object number of the root Pages object.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered.



inheritFieldAttributes
public PjDictionary inheritFieldAttributes(PjDictionary node) throws InvalidPdfObjectException(Code)
Returns a clone of a field node such that all inherited attributes of the given field node are made explicit. For example, if the V key is not defined in the given field node, this method ascends the field tree (via the Parent reference) looking for an ancestor node that does contain a value for the V key; if it finds one, it assigns that value in the cloned (returned) field node. This is done for all inheritable attributes.
Parameters:
  node - a field node for which inherited attributes areto be retrieved. a cloned copy of the given field node with actualvalues substituted for all inherited attributes.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered.



inheritPageAttributes
public PjPagesNode inheritPageAttributes(PjPagesNode node) throws InvalidPdfObjectException(Code)
Returns a clone of a pages node such that all inherited attributes of the given pages node are made explicit. For example, if MediaBox is not defined in the given pages node, this method ascends the pages tree (via the Parent reference) looking for an ancestor node that does contain a value for MediaBox; if it finds one, it assigns that value in the cloned (returned) pages node. This is done for all inheritable attributes.
Parameters:
  node - a pages node for which inherited attributes areto be retrieved. a cloned copy of the given pages node with actualvalues substituted for all inherited attributes.
exception:
  InvalidPdfObjectException - if an invalid objecttype is encountered.



registerObject
public int registerObject(PjObject obj)(Code)
Registers a PjObject within this PDF document.
Parameters:
  obj - the PjObject to register. the new object number of the registered PjObject.



registerObject
public void registerObject(PjObject obj, int objectNumber)(Code)
Registers a PjObject within this PDF document using a specified object number.
Parameters:
  obj - the PjObject to register.
Parameters:
  objectNumber - the object number to register obj under.



resolve
public PjObject resolve(PjObject obj)(Code)
Dereferences a PjObject if it is a PjReference.
Parameters:
  obj - the PjObject to dereference. the referenced PjObject if obj is a PjReference, or obj otherwise.



setEncryptDictionary
public void setEncryptDictionary(PjReference ref)(Code)
Sets the Encrypt dictionary within this document's trailer.
Parameters:
  ref - a reference to the Encrypt dictionary.



setEncryptDictionary
public void setEncryptDictionary(PjDictionary dict)(Code)
Sets the Encrypt dictionary within this document's trailer.
Parameters:
  dict - the Encrypt dictionary.



setInfoDictionary
public void setInfoDictionary(PjReference ref)(Code)
Sets the Info dictionary within this document's trailer.
Parameters:
  ref - a reference to the Info dictionary.



updateFieldValue
public void updateFieldValue(PjDictionary origField, PjDictionary field, String value) throws PdfFormatException, InvalidPdfObjectException(Code)



writeToFile
public void writeToFile(String filename) throws IOException(Code)
Writes this PDF document to a file in PDF format.
Parameters:
  filename - the name of the PDF file to create.
exception:
  IOException - if an I/O error occurs.



writeToStream
public void writeToStream(OutputStream os) throws IOException(Code)
Writes this PDF document to a stream in PDF format.
Parameters:
  os - the stream to write to.
exception:
  IOException - if an I/O error occurs.



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.