Java Doc for COSWriter.java in  » PDF » PDFBox-0.7.3 » org » pdfbox » pdfwriter » 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 » PDFBox 0.7.3 » org.pdfbox.pdfwriter 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.pdfbox.pdfwriter.COSWriter

COSWriter
public class COSWriter implements ICOSVisitor(Code)
this class acts on a in-memory representation of a pdf document. todo no support for incremental updates todo single xref section only todo no linearization
author:
   Michael Traut
author:
   Ben Litchfield
version:
   $Revision: 1.36 $


Field Summary
final public static  byte[]ARRAY_CLOSE
     The array close token.
final public static  byte[]ARRAY_OPEN
     The array open token.
final public static  byte[]COMMENT
     The start to a PDF comment.
final public static  byte[]DICT_CLOSE
     The dictionary close token.
final public static  byte[]DICT_OPEN
     The dictionary open token.
final public static  byte[]ENDOBJ
     The end object token.
final public static  byte[]ENDSTREAM
     The close stream token.
final public static  byte[]EOF
     The EOF constant.
final public static  byte[]GARBAGE
     Garbage bytes used to create the PDF header.
final public static  byte[]OBJ
     The starting object token.
final public static  byte[]REFERENCE
     The reference token.
final public static  byte[]SPACE
     space character.
final public static  byte[]STARTXREF
     The start xref token.
final public static  byte[]STREAM
     The open stream token.
final public static  byte[]TRAILER
     The trailer token.
final public static  byte[]VERSION
     The output version of the PDF.
final public static  byte[]XREF
     The XREF token.
final public static  byte[]XREF_FREE
     The xref free token.
final public static  byte[]XREF_USED
     The xref used token.

Constructor Summary
public  COSWriter(OutputStream os)
     COSWriter constructor comment.

Method Summary
protected  voidaddXRefEntry(COSWriterXRefEntry entry)
     add an entry in the x ref table for later dump.
public  voidclose()
     This will close the stream.
protected  voiddoWriteBody(COSDocument doc)
     This will write the body of the document.
protected  voiddoWriteHeader(COSDocument doc)
     This will write the header to the PDF document.
public  voiddoWriteObject(COSBase obj)
     This will write a COS object.
protected  voiddoWriteTrailer(COSDocument doc)
     This will write the trailer to the PDF document.
protected  voiddoWriteXRef(COSDocument doc)
    
protected  longgetNumber()
     This will get the current object number.
public  java.util.MapgetObjectKeys()
     This will get all available object keys.
protected  java.io.OutputStreamgetOutput()
     This will get the output stream.
protected  COSStandardOutputStreamgetStandardOutput()
     This will get the standard output stream.
protected  longgetStartxref()
     This will get the current start xref.
protected  java.util.ListgetXRefEntries()
     This will get the xref entries.
protected  voidsetNumber(long newNumber)
     This will set the current object number.
protected  voidsetStartxref(long newStartxref)
     This will set the start xref.
public  ObjectvisitFromArray(COSArray obj)
     visitFromArray method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromBoolean(COSBoolean obj)
     visitFromBoolean method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromDictionary(COSDictionary obj)
     visitFromDictionary method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromDocument(COSDocument doc)
     The visit from document method.
Parameters:
  doc - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromFloat(COSFloat obj)
     visitFromFloat method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromInt(COSInteger obj)
     visitFromFloat method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromName(COSName obj)
     visitFromName method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromNull(COSNull obj)
     visitFromNull method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromStream(COSStream obj)
     visitFromStream method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.
public  ObjectvisitFromString(COSString obj)
     visitFromString method comment.
Parameters:
  obj - The object that is being visited.
public  voidwrite(COSDocument doc)
     This will write the pdf document.
public  voidwrite(PDDocument doc)
     This will write the pdf document.
public  voidwriteReference(COSBase obj)
     visitFromObjRef method comment.

Field Detail
ARRAY_CLOSE
final public static byte[] ARRAY_CLOSE(Code)
The array close token.



ARRAY_OPEN
final public static byte[] ARRAY_OPEN(Code)
The array open token.



COMMENT
final public static byte[] COMMENT(Code)
The start to a PDF comment.



DICT_CLOSE
final public static byte[] DICT_CLOSE(Code)
The dictionary close token.



DICT_OPEN
final public static byte[] DICT_OPEN(Code)
The dictionary open token.



ENDOBJ
final public static byte[] ENDOBJ(Code)
The end object token.



ENDSTREAM
final public static byte[] ENDSTREAM(Code)
The close stream token.



EOF
final public static byte[] EOF(Code)
The EOF constant.



GARBAGE
final public static byte[] GARBAGE(Code)
Garbage bytes used to create the PDF header.



OBJ
final public static byte[] OBJ(Code)
The starting object token.



REFERENCE
final public static byte[] REFERENCE(Code)
The reference token.



SPACE
final public static byte[] SPACE(Code)
space character.



STARTXREF
final public static byte[] STARTXREF(Code)
The start xref token.



STREAM
final public static byte[] STREAM(Code)
The open stream token.



TRAILER
final public static byte[] TRAILER(Code)
The trailer token.



VERSION
final public static byte[] VERSION(Code)
The output version of the PDF.



XREF
final public static byte[] XREF(Code)
The XREF token.



XREF_FREE
final public static byte[] XREF_FREE(Code)
The xref free token.



XREF_USED
final public static byte[] XREF_USED(Code)
The xref used token.




Constructor Detail
COSWriter
public COSWriter(OutputStream os)(Code)
COSWriter constructor comment.
Parameters:
  os - The wrapped output stream.




Method Detail
addXRefEntry
protected void addXRefEntry(COSWriterXRefEntry entry)(Code)
add an entry in the x ref table for later dump.
Parameters:
  entry - The new entry to add.



close
public void close() throws IOException(Code)
This will close the stream.
throws:
  IOException - If the underlying stream throws an exception.



doWriteBody
protected void doWriteBody(COSDocument doc) throws IOException, COSVisitorException(Code)
This will write the body of the document.
Parameters:
  doc - The document to write the body for.
throws:
  IOException - If there is an error writing the data.
throws:
  COSVisitorException - If there is an error generating the data.



doWriteHeader
protected void doWriteHeader(COSDocument doc) throws IOException(Code)
This will write the header to the PDF document.
Parameters:
  doc - The document to get the data from.
throws:
  IOException - If there is an error writing to the stream.



doWriteObject
public void doWriteObject(COSBase obj) throws COSVisitorException(Code)
This will write a COS object.
Parameters:
  obj - The object to write.
throws:
  COSVisitorException - If there is an error visiting objects.



doWriteTrailer
protected void doWriteTrailer(COSDocument doc) throws IOException, COSVisitorException(Code)
This will write the trailer to the PDF document.
Parameters:
  doc - The document to create the trailer for.
throws:
  IOException - If there is an IOError while writing the document.
throws:
  COSVisitorException - If there is an error while generating the data.



doWriteXRef
protected void doWriteXRef(COSDocument doc) throws IOException(Code)
write the x ref section for the pdf file currently, the pdf is reconstructed from the scratch, so we write a single section todo support for incremental writing?
Parameters:
  doc - The document to write the xref from.
throws:
  IOException - If there is an error writing the data to the stream.



getNumber
protected long getNumber()(Code)
This will get the current object number. The current object number.



getObjectKeys
public java.util.Map getObjectKeys()(Code)
This will get all available object keys. A map of all object keys.



getOutput
protected java.io.OutputStream getOutput()(Code)
This will get the output stream. The output stream.



getStandardOutput
protected COSStandardOutputStream getStandardOutput()(Code)
This will get the standard output stream. The standard output stream.



getStartxref
protected long getStartxref()(Code)
This will get the current start xref. The current start xref.



getXRefEntries
protected java.util.List getXRefEntries()(Code)
This will get the xref entries. All available xref entries.



setNumber
protected void setNumber(long newNumber)(Code)
This will set the current object number.
Parameters:
  newNumber - The new object number.



setStartxref
protected void setStartxref(long newStartxref)(Code)
This will set the start xref.
Parameters:
  newStartxref - The new start xref attribute.



visitFromArray
public Object visitFromArray(COSArray obj) throws COSVisitorException(Code)
visitFromArray method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromBoolean
public Object visitFromBoolean(COSBoolean obj) throws COSVisitorException(Code)
visitFromBoolean method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromDictionary
public Object visitFromDictionary(COSDictionary obj) throws COSVisitorException(Code)
visitFromDictionary method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromDocument
public Object visitFromDocument(COSDocument doc) throws COSVisitorException(Code)
The visit from document method.
Parameters:
  doc - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromFloat
public Object visitFromFloat(COSFloat obj) throws COSVisitorException(Code)
visitFromFloat method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromInt
public Object visitFromInt(COSInteger obj) throws COSVisitorException(Code)
visitFromFloat method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromName
public Object visitFromName(COSName obj) throws COSVisitorException(Code)
visitFromName method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromNull
public Object visitFromNull(COSNull obj) throws COSVisitorException(Code)
visitFromNull method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromStream
public Object visitFromStream(COSStream obj) throws COSVisitorException(Code)
visitFromStream method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object. null



visitFromString
public Object visitFromString(COSString obj) throws COSVisitorException(Code)
visitFromString method comment.
Parameters:
  obj - The object that is being visited. null
throws:
  COSVisitorException - If there is an exception while visiting this object.



write
public void write(COSDocument doc) throws COSVisitorException(Code)
This will write the pdf document.
Parameters:
  doc - The document to write.
throws:
  COSVisitorException - If an error occurs while generating the data.



write
public void write(PDDocument doc) throws COSVisitorException(Code)
This will write the pdf document.
Parameters:
  doc - The document to write.
throws:
  COSVisitorException - If an error occurs while generating the data.



writeReference
public void writeReference(COSBase obj) throws COSVisitorException(Code)
visitFromObjRef method comment.
Parameters:
  obj - The object that is being visited.
throws:
  COSVisitorException - If there is an exception while visiting this object.



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.