| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| public static final byte[] | ARRAY_CLOSE
The array close token. |
| public static final byte[] | ARRAY_OPEN
The array open token. |
| private boolean | |
| private COSArray | |
| private long | |
| private long | |
| public static final byte[] | COMMENT
The start to a PDF comment. |
| private final CompressParameters | |
| private COSObjectKey | |
| 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. |
| private FDFDocument | |
| private static final NumberFormat | |
| private static final NumberFormat | |
| public static final byte[] | GARBAGE
Garbage bytes used to create the PDF header. |
| private RandomAccessRead | |
| private OutputStream | |
| private boolean | |
| private byte[] | |
| private final Map | |
| private long | |
| public static final byte[] | OBJ
The starting object token. |
| private final Map | |
| private final Deque | |
| private OutputStream | |
| private PDDocument | |
| private boolean | |
| public static final byte[] | REFERENCE
The reference token. |
| private SignatureInterface | |
| private long | |
| private long | |
| public static final byte[] | SPACE
space character. |
| private COSStandardOutputStream | |
| public static final byte[] | STARTXREF
The start xref token. |
| private long | |
| 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. |
| private boolean | |
| private final Set | |
| 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. |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | COSWriter(OutputStream
The output stream to write the PDF. It will be closed when this object is
closed. outputStream)COSWriter constructor. |
| public | COSWriter(OutputStream
The output stream to write the PDF. It will be closed when this object is closed. outputStream, CompressParameters The configuration for the document's compression. compressParameters)COSWriter constructor. |
| public | COSWriter(OutputStream
output stream where the new PDF data will be written. It will be closed when this object is
closed. outputStream, RandomAccessRead random access read containing source PDF data inputData)COSWriter constructor for incremental updates. |
| public | COSWriter(OutputStream
output stream where the new PDF data will be written. It will be closed
when this object is closed. outputStream, RandomAccessRead random access read containing source PDF data. inputData, Set<COSDictionary> objects that must be part of the incremental saving. objectsToWrite)Constructor for incremental updates with a list of objects to write. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| protected void | addXRefEntry(XReferenceEntry
The new entry to add. entry)add an entry in the x ref table for later dump. |
| private void | |
| protected void | doWriteBody(COSDocument
The document to write the body for. doc)This will write the body of the document. |
| private void | doWriteBodyCompressed(COSDocument
The document to write the body for. document)This will write the compressed body of the document. |
| protected void | doWriteHeader(COSDocument
The document to get the data from. doc)This will write the header to the PDF document. |
| private void | |
| public void | doWriteObject(COSObjectKey
The key of the object to write. key, COSBase The object to write. obj)This will write a COS object for a predefined key. |
| public void | |
| private void | |
| private void | |
| protected void | doWriteTrailer(COSDocument
The document to create the trailer for. doc)This will write the trailer to the PDF document. |
| private void | |
| private void | |
| private void | |
| public InputStream | |
| private COSObjectKey | Returns: The object key for the object.The object to get the key for. obj)This will get the object key for the object. |
| protected OutputStream | |
| protected COSStandardOutputStream | |
| protected long | |
| protected List | |
| protected Long[] | Returns: a integer array with the rangeslist with the xRef entries that was written xRefEntriesList)check the xref entries and write out the ranges. |
| public boolean | Returns: True, if the resulting document shall be compressed.Returns true, if the resulting document shall be compressed. |
| private boolean | isNeedToBeUpdated(COSBase base)
Convenience method, so that we get false for types that can't be updated. |
| private void | |
| private void | |
| private void | setStandardOutput(COSStandardOutputStream
The new standard output stream. newStandardOutput)This will set the standard output stream. |
| protected void | |
| public void | visitFromArray(COSArray
The Object that is being visited. array)Implements org. Notification of visit to Array object. |
| public void | visitFromBoolean(COSBoolean
The Object that is being visited. obj)Implements org. Notification of visit to boolean object. |
| public void | visitFromDictionary(COSDictionary
The Object that is being visited. obj)Implements org. Notification of visit to dictionary object. |
| public void | visitFromDocument(COSDocument
The Object that is being visited. doc)Implements org. Notification of visit to document object. |
| public void | visitFromFloat(COSFloat
The Object that is being visited. obj)Implements org. Notification of visit to float object. |
| public void | visitFromInt(COSInteger
The Object that is being visited. obj)Implements org. Notification of visit to integer object. |
| public void | visitFromName(COSName
The Object that is being visited. obj)Implements org. Notification of visit to name object. |
| public void | visitFromNull(COSNull
The Object that is being visited. obj)Implements org. Notification of visit to null object. |
| public void | visitFromStream(COSStream
The Object that is being visited. obj)Implements org. Notification of visit to stream object. |
| public void | visitFromString(COSString
The Object that is being visited. obj)Implements org. Notification of visit to string object. |
| public void | |
| public void | |
| public void | write(PDDocument
The document to write. doc, SignatureInterface class to be used for signing; signInterface)null if external signing would be performed
or there will be no signing at allThis will write the pdf document. |
| public void | |
| private void | |
| private void | |
| public void | writeExternalSignature(byte[]
CMS signature byte array cmsSignature)Write externally created signature of PDF data obtained via |
| public void | |
| public static void | writeString(COSString
COSString to be written string, OutputStream The stream to write to. output)This will output the given byte getString as a PDF object. |
| public static void | writeString(byte[]
byte array representation of a string to be written bytes, OutputStream The stream to write to. output)This will output the given text/byte getString as a PDF object. |
| private static void | writeString(byte[] bytes, boolean forceHex, OutputStream
The stream to write to. output)This will output the given text/byte string as a PDF object. |
| private void | |
| private void |
| actualsAdded | back to summary |
|---|---|
| private final Set<COSBase> actualsAdded | |
| ARRAY_CLOSE | back to summary |
|---|---|
| public static final byte[] ARRAY_CLOSE The array close token. | |
| ARRAY_OPEN | back to summary |
|---|---|
| public static final byte[] ARRAY_OPEN The array open token. | |
| blockAddingObject | back to summary |
|---|---|
| private boolean blockAddingObject | |
| byteRangeArray | back to summary |
|---|---|
| private COSArray byteRangeArray | |
| byteRangeLength | back to summary |
|---|---|
| private long byteRangeLength | |
| byteRangeOffset | back to summary |
|---|---|
| private long byteRangeOffset | |
| COMMENT | back to summary |
|---|---|
| public static final byte[] COMMENT The start to a PDF comment. | |
| compressParameters | back to summary |
|---|---|
| private final CompressParameters compressParameters | |
| currentObjectKey | back to summary |
|---|---|
| private COSObjectKey currentObjectKey | |
| DICT_CLOSE | back to summary |
|---|---|
| public static final byte[] DICT_CLOSE The dictionary close token. | |
| DICT_OPEN | back to summary |
|---|---|
| public static final byte[] DICT_OPEN The dictionary open token. | |
| ENDOBJ | back to summary |
|---|---|
| public static final byte[] ENDOBJ The end object token. | |
| ENDSTREAM | back to summary |
|---|---|
| public static final byte[] ENDSTREAM The close stream token. | |
| EOF | back to summary |
|---|---|
| public static final byte[] EOF The EOF constant. | |
| fdfDocument | back to summary |
|---|---|
| private FDFDocument fdfDocument | |
| formatXrefGeneration | back to summary |
|---|---|
| private static final NumberFormat formatXrefGeneration | |
| formatXrefOffset | back to summary |
|---|---|
| private static final NumberFormat formatXrefOffset | |
| GARBAGE | back to summary |
|---|---|
| public static final byte[] GARBAGE Garbage bytes used to create the PDF header. | |
| incrementalInput | back to summary |
|---|---|
| private RandomAccessRead incrementalInput | |
| incrementalOutput | back to summary |
|---|---|
| private OutputStream incrementalOutput | |
| incrementalUpdate | back to summary |
|---|---|
| private boolean incrementalUpdate | |
| incrementPart | back to summary |
|---|---|
| private byte[] incrementPart | |
| keyObject | back to summary |
|---|---|
| private final Map<COSObjectKey, COSBase> keyObject | |
| number | back to summary |
|---|---|
| private long number | |
| OBJ | back to summary |
|---|---|
| public static final byte[] OBJ The starting object token. | |
| objectKeys | back to summary |
|---|---|
private final Map<COSBase, COSObjectKey> objectKeys
| |
| objectsToWrite | back to summary |
|---|---|
| private final Deque<COSBase> objectsToWrite | |
| output | back to summary |
|---|---|
| private OutputStream output | |
| pdDocument | back to summary |
|---|---|
| private PDDocument pdDocument | |
| reachedSignature | back to summary |
|---|---|
| private boolean reachedSignature | |
| REFERENCE | back to summary |
|---|---|
| public static final byte[] REFERENCE The reference token. | |
| signatureInterface | back to summary |
|---|---|
| private SignatureInterface signatureInterface | |
| signatureLength | back to summary |
|---|---|
| private long signatureLength | |
| signatureOffset | back to summary |
|---|---|
| private long signatureOffset | |
| SPACE | back to summary |
|---|---|
| public static final byte[] SPACE space character. | |
| standardOutput | back to summary |
|---|---|
| private COSStandardOutputStream standardOutput | |
| STARTXREF | back to summary |
|---|---|
| public static final byte[] STARTXREF The start xref token. | |
| startxref | back to summary |
|---|---|
| private long startxref | |
| STREAM | back to summary |
|---|---|
| public static final byte[] STREAM The open stream token. | |
| TRAILER | back to summary |
|---|---|
| public static final byte[] TRAILER The trailer token. | |
| VERSION | back to summary |
|---|---|
| public static final byte[] VERSION The output version of the PDF. | |
| willEncrypt | back to summary |
|---|---|
| private boolean willEncrypt | |
| writtenObjects | back to summary |
|---|---|
| private final Set<COSBase> writtenObjects | |
| XREF | back to summary |
|---|---|
| public static final byte[] XREF The XREF token. | |
| XREF_FREE | back to summary |
|---|---|
| public static final byte[] XREF_FREE The xref free token. | |
| XREF_USED | back to summary |
|---|---|
| public static final byte[] XREF_USED The xref used token. | |
| xRefEntries | back to summary |
|---|---|
| private final List<XReferenceEntry> xRefEntries | |
| COSWriter | back to summary |
|---|---|
| public COSWriter(OutputStream outputStream) COSWriter constructor.
| |
| COSWriter | back to summary |
|---|---|
| public COSWriter(OutputStream outputStream, CompressParameters compressParameters) COSWriter constructor.
| |
| COSWriter | back to summary |
|---|---|
| public COSWriter(OutputStream outputStream, RandomAccessRead inputData) throws IOException COSWriter constructor for incremental updates. There must be a path of objects that have
| |
| COSWriter | back to summary |
|---|---|
| public COSWriter(OutputStream outputStream, RandomAccessRead inputData, Set<COSDictionary> objectsToWrite) throws IOException Constructor for incremental updates with a list of objects to write. This allows to
include objects even if there is no path of objects that have
| |
| addObjectToWrite | back to summary |
|---|---|
| private void addObjectToWrite(COSBase object) | |
| addXRefEntry | back to summary |
|---|---|
| protected void addXRefEntry(XReferenceEntry entry) add an entry in the x ref table for later dump.
| |
| detectPossibleSignature | back to summary |
|---|---|
| private void detectPossibleSignature(COSDictionary obj) throws IOException | |
| doWriteBody | back to summary |
|---|---|
| protected void doWriteBody(COSDocument doc) throws IOException This will write the body of the document.
| |
| doWriteBodyCompressed | back to summary |
|---|---|
| private void doWriteBodyCompressed(COSDocument document) throws IOException This will write the compressed body of the document.
| |
| doWriteHeader | back to summary |
|---|---|
| protected void doWriteHeader(COSDocument doc) throws IOException This will write the header to the PDF document.
| |
| doWriteIncrement | back to summary |
|---|---|
| private void doWriteIncrement() throws IOException Write an incremental update for a non signature case. This can be used for e.g. augmenting signatures. | |
| doWriteObject | back to summary |
|---|---|
| public void doWriteObject(COSObjectKey key, COSBase obj) throws IOException This will write a COS object for a predefined key.
| |
| doWriteObject | back to summary |
|---|---|
| public void doWriteObject(COSBase obj) throws IOException This will write a COS object.
| |
| doWriteObjects | back to summary |
|---|---|
| private void doWriteObjects() throws IOException | |
| doWriteSignature | back to summary |
|---|---|
| private void doWriteSignature() throws IOException | |
| doWriteTrailer | back to summary |
|---|---|
| protected void doWriteTrailer(COSDocument doc) throws IOException This will write the trailer to the PDF document.
| |
| doWriteXRefInc | back to summary |
|---|---|
| private void doWriteXRefInc(COSDocument doc) throws IOException | |
| doWriteXRefTable | back to summary |
|---|---|
| private void doWriteXRefTable() throws IOException | |
| fillGapsWithFreeEntries | back to summary |
|---|---|
| private void fillGapsWithFreeEntries() | |
| getDataToSign | back to summary |
|---|---|
| public InputStream getDataToSign() throws IOException Return the stream of PDF data to be signed. Clients should use this method only to create
signatures externally.
When
| |
| getObjectKey | back to summary |
|---|---|
| private COSObjectKey getObjectKey(COSBase obj) This will get the object key for the object.
| |
| getOutput | back to summary |
|---|---|
| protected OutputStream getOutput() This will get the output stream.
| |
| getStandardOutput | back to summary |
|---|---|
| protected COSStandardOutputStream getStandardOutput() This will get the standard output stream.
| |
| getStartxref | back to summary |
|---|---|
| protected long getStartxref() This will get the current start xref.
| |
| getXRefEntries | back to summary |
|---|---|
| protected List This will get the xref entries.
| |
| getXRefRanges | back to summary |
|---|---|
| protected Long[] getXRefRanges(List<XReferenceEntry> xRefEntriesList) check the xref entries and write out the ranges. The format of the returned array is exactly the same as the pdf specification. See section 7.5.4 of ISO32000-1:2008, example 1 (page 40) for reference. example: 0 1 2 5 6 7 8 10 will create a array with follow ranges 0 3 5 4 10 1 this mean that the element 0 is followed by two other related numbers that represent a cluster of the size 3. 5 is follow by three other related numbers and create a cluster of size 4. etc.
| |
| isCompress | back to summary |
|---|---|
| public boolean isCompress() Returns true, if the resulting document shall be compressed.
| |
| isNeedToBeUpdated | back to summary |
|---|---|
| private boolean isNeedToBeUpdated(COSBase base) Convenience method, so that we get false for types that can't be updated. | |
| prepareIncrement | back to summary |
|---|---|
| private void prepareIncrement() | |
| setOutput | back to summary |
|---|---|
| private void setOutput(OutputStream newOutput) This will set the output stream.
| |
| setStandardOutput | back to summary |
|---|---|
| private void setStandardOutput(COSStandardOutputStream newStandardOutput) This will set the standard output stream.
| |
| setStartxref | back to summary |
|---|---|
| protected void setStartxref(long newStartxref) This will set the start xref.
| |
| visitFromArray | back to summary |
|---|---|
| public void visitFromArray(COSArray array) throws IOException Implements org. Doc from org. Notification of visit to Array object.
| |
| visitFromBoolean | back to summary |
|---|---|
| public void visitFromBoolean(COSBoolean obj) throws IOException Implements org. Doc from org. Notification of visit to boolean object.
| |
| visitFromDictionary | back to summary |
|---|---|
| public void visitFromDictionary(COSDictionary obj) throws IOException Implements org. Doc from org. Notification of visit to dictionary object.
| |
| visitFromDocument | back to summary |
|---|---|
| public void visitFromDocument(COSDocument doc) throws IOException Implements org. Doc from org. Notification of visit to document object.
| |
| visitFromFloat | back to summary |
|---|---|
| public void visitFromFloat(COSFloat obj) throws IOException Implements org. Doc from org. Notification of visit to float object.
| |
| visitFromInt | back to summary |
|---|---|
| public void visitFromInt(COSInteger obj) throws IOException Implements org. Doc from org. Notification of visit to integer object.
| |
| visitFromName | back to summary |
|---|---|
| public void visitFromName(COSName obj) throws IOException Implements org. Doc from org. Notification of visit to name object.
| |
| visitFromNull | back to summary |
|---|---|
| public void visitFromNull(COSNull obj) throws IOException Implements org. Doc from org. Notification of visit to null object.
| |
| visitFromStream | back to summary |
|---|---|
| public void visitFromStream(COSStream obj) throws IOException Implements org. Doc from org. Notification of visit to stream object.
| |
| visitFromString | back to summary |
|---|---|
| public void visitFromString(COSString obj) throws IOException Implements org. Doc from org. Notification of visit to string object.
| |
| write | back to summary |
|---|---|
| public void write(COSDocument doc) throws IOException This will write the pdf document.
| |
| write | back to summary |
|---|---|
| public void write(PDDocument doc) throws IOException This will write the pdf document. If signature should be created externally,
| |
| write | back to summary |
|---|---|
| public void write(PDDocument doc, SignatureInterface signInterface) throws IOException This will write the pdf document. If signature should be created externally,
| |
| write | back to summary |
|---|---|
| public void write(FDFDocument doc) throws IOException This will write the fdf document.
| |
| writeArray | back to summary |
|---|---|
| private void writeArray(COSArray array) throws IOException | |
| writeDictionary | back to summary |
|---|---|
| private void writeDictionary(COSDictionary dictionary) throws IOException | |
| writeExternalSignature | back to summary |
|---|---|
| public void writeExternalSignature(byte[] cmsSignature) throws IOException Write externally created signature of PDF data obtained via
| |
| writeReference | back to summary |
|---|---|
| public void writeReference(COSBase obj) throws IOException visitFromObjRef method comment.
| |
| writeString | back to summary |
|---|---|
| public static void writeString(COSString string, OutputStream output) throws IOException This will output the given byte getString as a PDF object.
| |
| writeString | back to summary |
|---|---|
| public static void writeString(byte[] bytes, OutputStream output) throws IOException This will output the given text/byte getString as a PDF object.
| |
| writeString | back to summary |
|---|---|
| private static void writeString(byte[] bytes, boolean forceHex, OutputStream output) throws IOException This will output the given text/byte string as a PDF object.
| |
| writeXrefEntry | back to summary |
|---|---|
| private void writeXrefEntry(XReferenceEntry entry) throws IOException | |
| writeXrefRange | back to summary |
|---|---|
| private void writeXrefRange(long x, long y) throws IOException | |