Class ImageImporter
- java.lang.Object
-
- org.faceless.pdf2.viewer2.ViewerFeature
-
- org.faceless.pdf2.viewer2.Importer
-
- org.faceless.pdf2.viewer2.feature.ImageImporter
-
public class ImageImporter extends Importer
A subclass ofImporter
that allows bitmap images to be converted to PDF documents and loaded directly into thePDFViewer
. This class handles all the formats supported by thePDFImage
class, namely TIFF, PNG, GIF, JPEG, PNM and JPEG-2000. The name of this feature is ImageImporterThis code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
- Since:
- 2.10.2.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.faceless.pdf2.viewer2.Importer
Importer.ImporterTask
-
-
Constructor Summary
Constructors Constructor Description ImageImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canLoad(String mimeType)
Returns true if this importer can load a file or stream of the specified MIME Content-Type.FileFilter
getFileFilter()
Get aFileFilter
that can be used to choose files acceptable to this Importer.Importer.ImporterTask
getImporter(PDFViewer viewer, File file)
Return anImporter.ImporterTask
that will load a PDF into the viewer from the specifed File.Importer.ImporterTask
getImporter(PDFViewer viewer, InputStream in, String title, File file)
Return anImporter.ImporterTask
that will load a PDF into the viewer from the specifed InputStream.protected boolean
isPDFImporter()
Indicates whether this importer loads from a PDF document.boolean
matches(File file)
Return true if this Importer can load the specified file.-
Methods inherited from class org.faceless.pdf2.viewer2.Importer
getImporter, getParser, initialize, isAddToMostRecent, processPDF, setAddToMostRecent
-
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown, toString
-
-
-
-
Method Detail
-
isPDFImporter
protected boolean isPDFImporter()
Description copied from class:Importer
Indicates whether this importer loads from a PDF document.- Overrides:
isPDFImporter
in classImporter
-
getFileFilter
public FileFilter getFileFilter()
Description copied from class:Importer
Get aFileFilter
that can be used to choose files acceptable to this Importer.- Specified by:
getFileFilter
in classImporter
-
matches
public boolean matches(File file) throws IOException
Description copied from class:Importer
Return true if this Importer can load the specified file.- Specified by:
matches
in classImporter
- Parameters:
file
- the File to be checked.- Returns:
- true if this file can be loaded by this Importer, false otherwise
- Throws:
IOException
-
canLoad
public boolean canLoad(String mimeType)
Description copied from class:Importer
Returns true if this importer can load a file or stream of the specified MIME Content-Type.
-
getImporter
public Importer.ImporterTask getImporter(PDFViewer viewer, File file)
Description copied from class:Importer
Return anImporter.ImporterTask
that will load a PDF into the viewer from the specifed File.- Specified by:
getImporter
in classImporter
- Parameters:
viewer
- the PDFViewerfile
- the FILE to load the PDF from- Returns:
- an
Importer.ImporterTask
to load the PDF
-
getImporter
public Importer.ImporterTask getImporter(PDFViewer viewer, InputStream in, String title, File file)
Description copied from class:Importer
Return anImporter.ImporterTask
that will load a PDF into the viewer from the specifed InputStream.- Specified by:
getImporter
in classImporter
- Parameters:
viewer
- the PDFViewerin
- the InputStream to load the PDF fromtitle
- the title to give that PDF - may be nullfile
- if the PDF is later saved, the file to initialize the path to - may be null.- Returns:
- an
Importer.ImporterTask
to load the PDF
-
-