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();
    
     
    • Method Detail

      • 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