pdftools_sdk.image.document
Classes
|
The base class for image documents |
- class pdftools_sdk.image.document.Document(handle)[source]
Bases:
_NativeObject
,ABC
The base class for image documents
Image documents are either opened using
pdftools_sdk.image.document.Document.open()
or the result of an operation, e.g. of PDF to image conversion usingpdftools_sdk.pdf2_image.converter.Converter.convert_page()
.- static open(stream: IOBase) Document [source]
Open an image document
Documents opened with this method are read-only and cannot be modified.
- Parameters:
stream (io.IOBase) – The stream from which the image is read.
- Returns:
The newly created document instance
- Return type:
- Raises:
pdftools_sdk.license_error.LicenseError – The license check has failed.
pdftools_sdk.unknown_format_error.UnknownFormatError – The document has a not recognized image format.
pdftools_sdk.corrupt_error.CorruptError – The document is corrupt or not an image.