Class Java2DRendererBuilder

    • Constructor Detail

      • Java2DRendererBuilder

        public Java2DRendererBuilder()
    • Method Detail

      • useLayoutGraphics

        public Java2DRendererBuilder useLayoutGraphics​(java.awt.Graphics2D g2d)
        Compulsory method. The layout graphics are used to measure text and should be from an image or device with the same characteristics as the output graphicsw provided by the page processor.
        Parameters:
        g2d -
        Returns:
        this for method chaining
      • useEnvironmentFonts

        public Java2DRendererBuilder useEnvironmentFonts​(boolean useEnvironmentFonts)
        Whether to use fonts available in the environment. Enabling environment fonts may mean different text rendering behavior across different environments. The default is not to use environment fonts.
      • toSinglePage

        public Java2DRendererBuilder toSinglePage​(FSPageProcessor pageProcessor)
        Render everything to a single page. I.e. only one big page is genereated, no pagebreak will be done. The page is only as height as needed.
      • toPageProcessor

        public Java2DRendererBuilder toPageProcessor​(FSPageProcessor pageProcessor)
        Output the document in paged format. The user can use the DefaultPageProcessor or use its source as a reference to code their own page processor for advanced usage.
        Parameters:
        pageProcessor -
        Returns:
        this for method chaining
      • runPaged

        public void runPaged()
                      throws java.io.IOException
        useLayoutGraphics and toPageProcessor MUST have been called. Also a document MUST have been set with one of the with* methods. This will build the renderer and output each page of the document to the specified page processor.
        Throws:
        java.lang.Exception
        java.io.IOException
      • runFirstPage

        public void runFirstPage()
                          throws java.io.IOException
        useLayoutGraphics and toPageProcessor MUST have been called. Also a document MUST have been set with one of the with* methods. This will build the renderer and output the first page of the document to the specified page processor.
        Throws:
        java.lang.Exception
        java.io.IOException
      • buildJava2DRenderer

        public Java2DRenderer buildJava2DRenderer​(java.io.Closeable diagnosticConsumer)