Class Exporter

  • Direct Known Subclasses:
    PDFExporter, TextExporter, TIFFExporter

    public abstract class Exporter
    extends ViewerFeature
    A type of ViewerFeature which allows PDF's to be saved in a variety of formats. It's chiefly used with the Save widget, although it can be used in other contexts if necessary.

    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
    • Constructor Detail

      • Exporter

        public Exporter​(java.lang.String name)
        Create a new Exporter
        Parameters:
        name - the name of the feature
    • Method Detail

      • getFileFilter

        public abstract javax.swing.filechooser.FileFilter getFileFilter()
        Get a FileFilter that matches the Files output by this Exporter
      • getFileSuffix

        public abstract java.lang.String getFileSuffix()
        Return the suffix of files normally output by this Exporter, such as "pdf", "tif", "jpg" etc.
      • isEnabled

        public boolean isEnabled​(DocumentPanel docpanel)
        Return true if this Exporter should be available for this DocumentPanel. The default implementation always returns true.
        Since:
        2.10.3
      • getComponent

        public javax.swing.JComponent getComponent​(DocumentPanel panel,
                                                   java.io.File file)

        Return a JComponent which prompts the user for additional information after the initial save dialog. An example might be when saving to a bitmap format - this component could prompt for image resolution and so on. If this method returns null (the default), then no additional component will be displayed on save.

        By default this method calls return getComponent(), which calls the legacy method which was the recommended approach prior to 2.15.1

        Parameters:
        panel - the DocumentPanel containing the PDF being saved
        file - the File being saved to
        Since:
        2.15.1
      • preProcessPDF

        public void preProcessPDF​(PDF pdf)
        Called by Exporter.ExporterTask.savePDF() just before the PDF is saved, you can override this method for custom processing. By default it's a no-op
        Since:
        2.13
      • postProcessPDF

        public void postProcessPDF​(PDF pdf)
        Called by Exporter.ExporterTask.savePDF() just after the PDF is saved, you can override this method for custom processing. By default it's a no-op
        Since:
        2.13