Class PrintRenderer

All Implemented Interfaces:
Pageable, 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 Details

    • PRINTER_JOB

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

      public static final String COPIES
      Printing parameter: the number of copies of the document to be printed, datatype: a positive Integer
      See Also:
  • Constructor Details

    • 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 Details

    • getPrinterJob

      public 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 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:
      IOException - If an I/O error occurs