Package com.pdftools.image
Class Document
- java.lang.Object
-
- com.pdftools.internal.NativeBase
-
- com.pdftools.internal.NativeObject
-
- com.pdftools.image.Document
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
MultiPageDocument
,SinglePageDocument
public abstract class Document extends NativeObject implements java.lang.AutoCloseable
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 usingpdftools.pdf2image.Converter.convertPage
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the object.static Document
open(Stream stream)
Open an image document-
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
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.java.lang.IllegalArgumentException
- ifstream
isnull
-
close
public void close() throws PdfToolsException, java.io.IOException
Close the object.
Release all resources associated with the object.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
PdfToolsException
- only explicitly stated in a superclassjava.io.IOException
-
-