PdfCosWriter
Overview
PdfCosWriter is a class in Aspose.PDF FOSS for Python.
Serialize a :class:PdfDocument to a PDF byte sequence.
This class provides 3 methods for working with PdfCosWriter objects in Python programs.
Available methods include: __init__, serialize_object, write.
All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.
Properties: doc, pdf_version, use_object_streams.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
doc | `` | Read | Gets the doc. |
pdf_version | `` | Read | Gets the pdf version. |
use_object_streams | `` | Read | Gets the use object streams. |
Methods
| Signature | Description |
|---|---|
__init__(doc: PdfDocument, pdf_version: str, use_object_streams: bool) | Calls init(doc, pdf_version, use_object_streams) on this PdfCosWriter instance. |
write() → bytes | Serialise the document and return the PDF bytes. |
serialize_object(obj: PdfObject) → str | Dispatch serialisation based on object type. |