Package com.pd4ml.pdf.cos.writer
Class COSDocumentWriter
- java.lang.Object
-
- com.pd4ml.pdf.cos.writer.COSDocumentWriter
-
public final class COSDocumentWriter extends java.lang.ObjectSerializes a wholeCOSDocumentbuilt up in memory (e.g. bycom.pd4ml.pdf.merge) into a complete, self-contained PDF file: header, every registered indirect object, a classic xref table, and a trailer -- as opposed toCOSWriter(one object's syntax only) orIncrementalUpdateWriter(an update appended to one specific original document's original bytes).The document's objects are expected to have been allocated with contiguous object numbers starting at 1 (which is what every allocator in
COSObjectImporterguarantees); any gap is still handled (written as a free xref entry) but is not something this writer's own callers are expected to produce.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]write(COSDocument document)Writesdocumentas a complete PDF file.
-
-
-
Method Detail
-
write
public static byte[] write(COSDocument document) throws COSException
Writesdocumentas a complete PDF file.document's trailer must already have a/Rootentry pointing at an indirect (keyed) Catalog object.- Throws:
COSException
-
-