Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.pdfbox.pdfwriter.COSWriter
Field Summary | |
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
static byte[] |
|
Constructor Summary | |
|
Method Summary | |
protected void |
|
void |
|
protected void |
|
protected void |
|
void |
|
protected void |
|
protected void |
|
protected long |
|
Map |
|
protected OutputStream |
|
protected COSStandardOutputStream |
|
protected long |
|
protected List |
|
protected void |
|
protected void |
|
Object |
|
Object |
|
Object |
|
Object |
|
Object |
|
Object |
|
Object |
|
Object |
|
Object |
|
Object |
|
void |
|
void |
|
void |
|
public static final byte[] ARRAY_CLOSE
The array close token.
public static final byte[] ARRAY_OPEN
The array open token.
public static final byte[] COMMENT
The start to a PDF comment.
public static final byte[] DICT_CLOSE
The dictionary close token.
public static final byte[] DICT_OPEN
The dictionary open token.
public static final byte[] ENDOBJ
The end object token.
public static final byte[] ENDSTREAM
The close stream token.
public static final byte[] EOF
The EOF constant.
public static final byte[] GARBAGE
Garbage bytes used to create the PDF header.
public static final byte[] OBJ
The starting object token.
public static final byte[] REFERENCE
The reference token.
public static final byte[] SPACE
space character.
public static final byte[] STARTXREF
The start xref token.
public static final byte[] STREAM
The open stream token.
public static final byte[] TRAILER
The trailer token.
public static final byte[] VERSION
The output version of the PDF.
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 COSWriter(OutputStream os)
COSWriter constructor comment.
- Parameters:
os
- The wrapped output stream.
protected void addXRefEntry(COSWriterXRefEntry entry)
add an entry in the x ref table for later dump.
- Parameters:
entry
- The new entry to add.
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.
- Parameters:
doc
- The document to write the body for.
- Throws:
COSVisitorException
- If there is an error generating the data.
protected void doWriteHeader(COSDocument doc) throws IOException
This will write the header to the PDF document.
- Parameters:
doc
- The document to get the data from.
public void doWriteObject(COSBase obj) throws COSVisitorException
This will write a COS object.
- Parameters:
obj
- The object to write.
- Throws:
COSVisitorException
- If there is an error visiting objects.
protected void doWriteTrailer(COSDocument doc) throws IOException, COSVisitorException
This will write the trailer to the PDF document.
- Parameters:
doc
- The document to create the trailer for.
- Throws:
COSVisitorException
- If there is an error while generating the data.
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?
- Parameters:
doc
- The document to write the xref from.
protected long getNumber()
This will get the current object number.
- Returns:
- The current object number.
public Map getObjectKeys()
This will get all available object keys.
- Returns:
- A map of all object keys.
protected OutputStream getOutput()
This will get the output stream.
- Returns:
- The output stream.
protected COSStandardOutputStream getStandardOutput()
This will get the standard output stream.
- Returns:
- The standard output stream.
protected long getStartxref()
This will get the current start xref.
- Returns:
- The current start xref.
protected List getXRefEntries()
This will get the xref entries.
- Returns:
- All available xref entries.
protected void setNumber(long newNumber)
This will set the current object number.
- Parameters:
newNumber
- The new object number.
protected void setStartxref(long newStartxref)
This will set the start xref.
- Parameters:
newStartxref
- The new start xref attribute.
public Object visitFromArray(COSArray obj) throws COSVisitorException
visitFromArray method comment.
- Specified by:
- visitFromArray in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromBoolean(COSBoolean obj) throws COSVisitorException
visitFromBoolean method comment.
- Specified by:
- visitFromBoolean in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromDictionary(COSDictionary obj) throws COSVisitorException
visitFromDictionary method comment.
- Specified by:
- visitFromDictionary in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromDocument(COSDocument doc) throws COSVisitorException
The visit from document method.
- Specified by:
- visitFromDocument in interface ICOSVisitor
- Parameters:
doc
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromFloat(COSFloat obj) throws COSVisitorException
visitFromFloat method comment.
- Specified by:
- visitFromFloat in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromInt(COSInteger obj) throws COSVisitorException
visitFromFloat method comment.
- Specified by:
- visitFromInt in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromName(COSName obj) throws COSVisitorException
visitFromName method comment.
- Specified by:
- visitFromName in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromNull(COSNull obj) throws COSVisitorException
visitFromNull method comment.
- Specified by:
- visitFromNull in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromStream(COSStream obj) throws COSVisitorException
visitFromStream method comment.
- Specified by:
- visitFromStream in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public Object visitFromString(COSString obj) throws COSVisitorException
visitFromString method comment.
- Specified by:
- visitFromString in interface ICOSVisitor
- Parameters:
obj
- The object that is being visited.
- Returns:
- null
- Throws:
COSVisitorException
- If there is an exception while visiting this object.
public void write(COSDocument doc) throws COSVisitorException
This will write the pdf document.
- Parameters:
doc
- The document to write.
- Throws:
COSVisitorException
- If an error occurs while generating the data.
public void write(PDDocument doc) throws COSVisitorException
This will write the pdf document.
- Parameters:
doc
- The document to write.
- Throws:
COSVisitorException
- If an error occurs while generating the data.
public void writeReference(COSBase obj) throws COSVisitorException
visitFromObjRef method comment.
- Parameters:
obj
- The object that is being visited.
- Throws:
COSVisitorException
- If there is an exception while visiting this object.