Interface StreamPrinter

  • All Known Subinterfaces:

    public interface StreamPrinter
    A representation of a virtual printer, that writes the output to an OutputStream instead of a physical printer.

    StreamPrinter may be used to generate a print stream based on a collection of pages.

    The most common way to access a StreamPrinter instance is, by using the StreamPrinterFactory. The StreamPrinterFactory defines some static methods to create instances of commonly used StreamPrinter instances.


       Document sourceDocument = // ... initialized somewhere else
       OutputStream output = // ... the designated output
       StreamPrinter psPrinter = StreamPrinterFactory.createPostscriptStreamPrinter();
       final Lock lock = sourceDocument.getPages().getReadWriteLock().getReadLock();
       try {
        // add all pages of a given document to the StreamPrinter
       } finally {
    • Method Detail

      • isAvailable

        boolean isAvailable()
        Determines, whether the given StreamPrinter instance is available. In some cases and on some systems not every StreamPrinter is available due to numerous restrictions like different implementations of the JavaVM.
        true if the StreamPrinter 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.

        never null. A mutable EventList of pages