Package com.pdftools.image
Class Document
java.lang.Object
com.pdftools.internal.NativeBase
com.pdftools.internal.NativeObject
com.pdftools.image.Document
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
MultiPageDocument,SinglePageDocument
The base class for image documents
Image documents are either opened usingopen(com.pdftools.sys.Stream) or the result of an operation, e.g. of PDF to image conversion using pdftools.pdf2image.Converter.convertPage.-
Method Summary
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
Method Details
-
open
public static Document open(Stream stream) throws LicenseException, UnknownFormatException, CorruptException Open an image document
Documents opened with this method are read-only and cannot be modified.- Parameters:
stream- The stream from which the image is read.- Returns:
- The newly created document instance
- Throws:
LicenseException- The license check has failed.UnknownFormatException- The document has a not recognized image format.CorruptException- The document is corrupt or not an image.IllegalArgumentException- ifstreamisnull
-
close
Close the object.
Release all resources associated with the object.- Specified by:
closein interfaceAutoCloseable- Throws:
PdfToolsException- only explicitly stated in a superclassIOException
-