Class PrintRenderer

  • All Implemented Interfaces:
    java.awt.print.Pageable, java.awt.print.Printable, Constants, Renderer

    public class PrintRenderer
    extends PageableRenderer
    Renderer that prints through java.awt.PrintJob. The actual printing is handled by Java2DRenderer since both PrintRenderer and AWTRenderer need to support printing.
    • Field Detail

      • PRINTER_JOB

        public static final java.lang.String PRINTER_JOB
        Printing parameter: the preconfigured PrinterJob to use, datatype: java.awt.print.PrinterJob
        See Also:
        Constant Field Values
      • COPIES

        public static final java.lang.String COPIES
        Printing parameter: the number of copies of the document to be printed, datatype: a positive Integer
        See Also:
        Constant Field Values
    • Constructor Detail

      • PrintRenderer

        public PrintRenderer​(FOUserAgent userAgent)
        Creates a new PrintRenderer with the options set through the renderer options if a custom PrinterJob is not given in FOUserAgent's renderer options.
        Parameters:
        userAgent - the user agent that contains configuration details. This cannot be null.
    • Method Detail

      • getPrinterJob

        public java.awt.print.PrinterJob getPrinterJob()
        Returns:
        the PrinterJob instance that this renderer prints to
      • getEndNumber

        public int getEndNumber()
        Returns:
        the ending page number
      • setEndPage

        public void setEndPage​(int end)
        Sets the number of the last page to be printed.
        Parameters:
        end - The ending page number
      • getStartPage

        public int getStartPage()
        Returns:
        the starting page number
      • setStartPage

        public void setStartPage​(int start)
        Sets the number of the first page to be printed.
        Parameters:
        start - The starting page number
      • stopRenderer

        public void stopRenderer()
                          throws java.io.IOException
        Signals the end of the rendering phase. The renderer should reset to an initial state and dispose of any resources for the completed rendering.
        Specified by:
        stopRenderer in interface Renderer
        Overrides:
        stopRenderer in class PageableRenderer
        Throws:
        java.io.IOException - If an I/O error occurs