Interface Exporter

All Known Subinterfaces:
JPSExporter

public interface Exporter
A representation of an exporter, that writes the output to an OutputStream.

Exporter may be used to generate an export based on a collection of pages.

The most common way to access an Exporter instance is, by using the ExporterFactory. The ExporterFactory defines some static methods to create instances of commonly used Exporter instances.


Example

   Document sourceDocument = // ... initialized somewhere else
   OutputStream output = // ... the designated output

   Exporter psExporter = ExporterFactory.createPostscriptExporter();
   final Lock lock = sourceDocument.getPages().getReadWriteLock().getReadLock();
   lock.lock();
   try {
    // add all pages of a given document to the exporter
    psExporter.getSourcePages().addAll(sourceDocument.getPages());
   } finally {
     lock.unlock();
   }

   exporter.export(output);
   output.close();

 
  • Field Details

  • Method Details

    • isAvailable

      boolean isAvailable()
      Determines, whether the given Exporter instance is available. In some cases and on some systems not every Exporter is available due to numerous restrictions like different implementations of the JavaVM.
      Returns:
      true if the Exporter instance is available and can be used.
    • getSourcePages

      org.jadice.util.glazedlists.EventList<Page> getSourcePages()
      A EventList with pages that shall be printed.

      The contents of this EventList are the source pages that will be printed.

      Returns:
      never null. A mutable EventList of pages
    • export

      void export(org.jadice.util.base.Provider<OutputStream,IOException> output) throws Exception
      Perform the export.
      Parameters:
      output -
      Throws:
      Exception
    • export

      void export(OutputStream output) throws Exception
      Perform the export.
      Parameters:
      output -
      Throws:
      Exception
    • addExportStatusListener

      default void addExportStatusListener(ExportStatusListener exportStatusListener)
    • onExportFailed

      default void onExportFailed()
    • setRenderControlsInventory

      default void setRenderControlsInventory(com.levigo.jadice.document.render.RenderControlsInventory renderControlsInventory)