PDFWriter
Overview
PDFWriter is a class in Aspose.PDF FOSS for Java.
Serializes a graph of PDF objects into a valid PDF file.
This class provides 7 methods for working with PDFWriter objects in Java programs.
Available methods include: PDFWriter, allocateObjectNumber, setEncryptor, write, writeCompressed, writeIncremental, writeIncrementalWithXRefStream.
All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package.
Methods
| Signature | Description |
|---|---|
setEncryptor(encryptor: PDFEncryptor, encryptDictKey: PdfObjectKey) | Sets the encryptor for write-side encryption. |
PDFWriter(output: OutputStream, pdfVersion: float) | Constructs a new PDFWriter. |
write(trailer: PdfDictionary, objects: Map<PdfObjectKey, PdfBase>) | Writes a complete PDF file: header, objects, xref table, and trailer. |
writeIncremental(original: RandomAccessReader, trailer: PdfDictionary, modifiedObjects: Map<PdfObjectKey, PdfBase>) | Writes an incremental update to an existing PDF. |
allocateObjectNumber() → PdfObjectKey | Assigns a new object number and returns the key. |
writeCompressed(trailer: PdfDictionary, objects: Map<PdfObjectKey, PdfBase>, maxPerStream: int) | Writes a complete PDF with object streams and xref stream (PDF 1.5+). |
writeIncrementalWithXRefStream(original: RandomAccessReader, trailer: PdfDictionary, modifiedObjects: Map<PdfObjectKey, PdfBase>) | Writes an incremental update using an xref stream instead of a text xref table. |