pdftools_sdk.optimization.optimizer

Classes

Optimizer()

The class to optimize PDF documents

class pdftools_sdk.optimization.optimizer.Optimizer[source]

Bases: _NativeObject

The class to optimize PDF documents

__init__()[source]
optimize_document(in_doc: Document, out_stream: io.IOBase, profile: Profile, out_options: OutputOptions | None = None) → Document[source]

Optimize the PDF document

Parameters:
  • inDoc (Document) – The input PDF document

  • outStream (io.IOBase) – The stream to which the output PDF is written

  • profile (Profile) – The profile defining the optimization parameters.

  • outOptions (Optional[OutputOptions]) – The PDF output options, e.g. to encrypt the output document.

Returns:

The optimized result PDF, which can be used as a new input for further processing.

Note that, this object must be disposed before the output stream object (method argument outStream).

Return type:

Document

Raises: