Home » pdfbox-1.1.0-src » org.apache.pdfbox.pdfwriter » [javadoc | source]
org.apache.pdfbox.pdfwriter
public class: COSWriter [javadoc | source]
java.lang.Object
   org.apache.pdfbox.pdfwriter.COSWriter

All Implemented Interfaces:
    ICOSVisitor

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
Field Summary
public static final  byte[] DICT_OPEN    The dictionary open token. 
public static final  byte[] DICT_CLOSE    The dictionary close token. 
public static final  byte[] SPACE    space character. 
public static final  byte[] COMMENT    The start to a PDF comment. 
public static final  byte[] VERSION    The output version of the PDF. 
public static final  byte[] GARBAGE    Garbage bytes used to create the PDF header. 
public static final  byte[] EOF    The EOF constant. 
public static final  byte[] REFERENCE    The reference token. 
public static final  byte[] XREF    The XREF token. 
public static final  byte[] XREF_FREE    The xref free token. 
public static final  byte[] XREF_USED    The xref used token. 
public static final  byte[] TRAILER    The trailer token. 
public static final  byte[] STARTXREF    The start xref token. 
public static final  byte[] OBJ    The starting object token. 
public static final  byte[] ENDOBJ    The end object token. 
public static final  byte[] ARRAY_OPEN    The array open token. 
public static final  byte[] ARRAY_CLOSE    The array close token. 
public static final  byte[] STREAM    The open stream token. 
public static final  byte[] ENDSTREAM    The close stream token. 
Constructor:
 public COSWriter(OutputStream os) 
    COSWriter constructor comment.
    Parameters:
    os - The wrapped output stream.
Method from org.apache.pdfbox.pdfwriter.COSWriter Summary:
addXRefEntry,   close,   doWriteBody,   doWriteHeader,   doWriteObject,   doWriteTrailer,   doWriteXRef,   getNumber,   getObjectKeys,   getOutput,   getStandardOutput,   getStartxref,   getXRefEntries,   setNumber,   setStartxref,   visitFromArray,   visitFromBoolean,   visitFromDictionary,   visitFromDocument,   visitFromFloat,   visitFromInt,   visitFromName,   visitFromNull,   visitFromStream,   visitFromString,   write,   write,   writeReference
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.pdfbox.pdfwriter.COSWriter Detail:
 protected  void addXRefEntry(COSWriterXRefEntry entry) 
    add an entry in the x ref table for later dump.
 public  void close() throws IOException 
    This will close the stream.
 protected  void doWriteBody(COSDocument doc) throws IOException, COSVisitorException 
    This will write the body of the document.
 protected  void doWriteHeader(COSDocument doc) throws IOException 
    This will write the header to the PDF document.
 public  void doWriteObject(COSBase obj) throws COSVisitorException 
    This will write a COS object.
 protected  void doWriteTrailer(COSDocument doc) throws IOException, COSVisitorException 
    This will write the trailer to the PDF document.
 protected  void doWriteXRef(COSDocument doc) throws IOException 
    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?
 protected long getNumber() 
    This will get the current object number.
 public Map getObjectKeys() 
    This will get all available object keys.
 protected OutputStream getOutput() 
    This will get the output stream.
 protected COSStandardOutputStream getStandardOutput() 
    This will get the standard output stream.
 protected long getStartxref() 
    This will get the current start xref.
 protected List getXRefEntries() 
    This will get the xref entries.
 protected  void setNumber(long newNumber) 
    This will set the current object number.
 protected  void setStartxref(long newStartxref) 
    This will set the start xref.
 public Object visitFromArray(COSArray obj) throws COSVisitorException 
    visitFromArray method comment.
 public Object visitFromBoolean(COSBoolean obj) throws COSVisitorException 
    visitFromBoolean method comment.
 public Object visitFromDictionary(COSDictionary obj) throws COSVisitorException 
    visitFromDictionary method comment.
 public Object visitFromDocument(COSDocument doc) throws COSVisitorException 
    The visit from document method.
 public Object visitFromFloat(COSFloat obj) throws COSVisitorException 
    visitFromFloat method comment.
 public Object visitFromInt(COSInteger obj) throws COSVisitorException 
    visitFromFloat method comment.
 public Object visitFromName(COSName obj) throws COSVisitorException 
    visitFromName method comment.
 public Object visitFromNull(COSNull obj) throws COSVisitorException 
    visitFromNull method comment.
 public Object visitFromStream(COSStream obj) throws COSVisitorException 
    visitFromStream method comment.
 public Object visitFromString(COSString obj) throws COSVisitorException 
    visitFromString method comment.
 public  void write(COSDocument doc) throws COSVisitorException 
    This will write the pdf document.
 public  void write(PDDocument doc) throws COSVisitorException 
    This will write the pdf document.
 public  void writeReference(COSBase obj) throws COSVisitorException 
    visitFromObjRef method comment.