Class PCLDocumentHandler

    • Field Detail

      • log

        private static org.apache.commons.logging.Log log
        logging instance
      • tempURI

        private java.net.URI tempURI
        the temporary file in case of two-pass processing
      • TEMP_URI_GENERATOR

        private static final org.apache.xmlgraphics.io.TempResourceURIGenerator TEMP_URI_GENERATOR
      • pclUtil

        protected PCLRenderingUtil pclUtil
        Utility class for handling all sorts of peripheral tasks around PCL generation.
      • pageWidth

        private long pageWidth
        contains the pageWith of the last printed page
      • pageHeight

        private long pageHeight
        contains the pageHeight of the last printed page
      • currentImage

        private java.awt.image.BufferedImage currentImage
        the current page image (only set when all-bitmap painting is activated)
    • Constructor Detail

      • PCLDocumentHandler

        public PCLDocumentHandler​(IFContext context)
        Default constructor.
    • Method Detail

      • supportsPagesOutOfOrder

        public boolean supportsPagesOutOfOrder()
        Indicates whether the painter supports to handle the pages in mixed order rather than ascending order.
        Specified by:
        supportsPagesOutOfOrder in interface IFDocumentHandler
        Returns:
        true if out-of-order handling is supported
      • getMimeType

        public java.lang.String getMimeType()
        Returns the MIME type of the output format that is generated by this implementation.
        Specified by:
        getMimeType in interface IFDocumentHandler
        Returns:
        the MIME type
      • getResolution

        protected int getResolution()
        Returns:
        the target resolution
      • rewritePCLFile

        private void rewritePCLFile()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • copy

        private void copy​(java.io.InputStream is,
                          long len)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • startPageSequence

        public void startPageSequence​(java.lang.String id)
                               throws IFException
        Indicates the start of a new page sequence.
        Specified by:
        startPageSequence in interface IFDocumentHandler
        Parameters:
        id - the page sequence's identifier (or null if none is available)
        Throws:
        IFException - if an error occurs while handling this event
      • startPage

        public void startPage​(int index,
                              java.lang.String name,
                              java.lang.String pageMasterName,
                              java.awt.Dimension size)
                       throws IFException
        Indicates the start of a new page.
        Specified by:
        startPage in interface IFDocumentHandler
        Parameters:
        index - the index of the page (0-based)
        name - the page name (usually the formatted page number)
        pageMasterName - the name of the simple-page-master that generated this page
        size - the size of the page (equivalent to the MediaBox in PDF)
        Throws:
        IFException - if an error occurs while handling this event
      • startPageContent

        public IFPainter startPageContent()
                                   throws IFException
        Indicates the start of the page content. The method returns an IFPainter interface which is used to paint the page contents.
        Specified by:
        startPageContent in interface IFDocumentHandler
        Returns:
        the IFPainter for the page content
        Throws:
        IFException - if an error occurs while handling this event
      • createAllBitmapPainter

        private IFPainter createAllBitmapPainter()
      • createBufferedImage

        private java.awt.image.BufferedImage createBufferedImage​(int bitmapWidth,
                                                                 int bitmapHeight)
      • handleExtensionObject

        public void handleExtensionObject​(java.lang.Object extension)
                                   throws IFException
        Handles an extension object. This can be a DOM document or any arbitrary object. If an implementation doesn't know how to handle a particular extension it is simply ignored.
        Specified by:
        handleExtensionObject in interface IFDocumentHandler
        Parameters:
        extension - the extension object
        Throws:
        IFException - if an error occurs while handling this event
      • selectPageFormat

        private void selectPageFormat​(long pagewidth,
                                      long pageheight)
                               throws java.io.IOException
        Throws:
        java.io.IOException