org.faceless.pdf2.viewer2.feature

## 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 of `Importer` that allows bitmap images to be converted to PDF documents and loaded directly into the `PDFViewer`. This class handles all the formats supported by the `PDFImage` class, namely TIFF, PNG, GIF, JPEG, PNM and JPEG-2000. The name of this feature is ImageImporter

  This 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 and Description
    `ImageImporter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 a `FileFilter` that can be used to choose files acceptable to this Importer.
    `Importer.ImporterTask` | `getImporter(PDFViewer viewer, File file)` Return an `Importer.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 an `Importer.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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ImageImporter

          public ImageImporter()

  - ### Method Detail

    - #### isPDFImporter

          protected boolean isPDFImporter()

      Description copied from class: `Importer`
      Indicates whether this importer loads from a PDF document.
      Overrides:
        `isPDFImporter` in class `Importer`

    - #### getFileFilter

          public FileFilter getFileFilter()

      Description copied from class: `Importer`
      Get a `FileFilter` that can be used to choose files acceptable to this Importer.
      Specified by:
        `getFileFilter` in class `Importer`

    - #### 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 class `Importer`
      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.
      Overrides:
        `canLoad` in class `Importer`
      Parameters:
        `mimeType` - the MIME content type

    - #### getImporter

          public Importer.ImporterTask getImporter(PDFViewer viewer,
                                                   File file)

      Description copied from class: `Importer`
      Return an `Importer.ImporterTask` that will load a PDF into the viewer from the specifed File.
      Specified by:
        `getImporter` in class `Importer`
      Parameters:
        `viewer` - the PDFViewer
        `file` - 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 an `Importer.ImporterTask` that will load a PDF into the viewer from the specifed InputStream.
      Specified by:
        `getImporter` in class `Importer`
      Parameters:
        `viewer` - the PDFViewer
        `in` - the InputStream to load the PDF from
        `title` - the title to give that PDF - may be null
        `file` - if the PDF is later saved, the file to initialize the path to - may be null.
      Returns:
        an `Importer.ImporterTask` to load the PDF

Copyright © 2001-2015 Big Faceless Organization