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

NameTypeAccessDescription
doc``ReadGets the doc.
pdf_version``ReadGets the pdf version.
use_object_streams``ReadGets the use object streams.

Methods

SignatureDescription
__init__(doc: PdfDocument, pdf_version: str, use_object_streams: bool)Calls init(doc, pdf_version, use_object_streams) on this PdfCosWriter instance.
write()bytesSerialise the document and return the PDF bytes.
serialize_object(obj: PdfObject)strDispatch serialisation based on object type.

See Also