Optimize the rendering process

You can optimize the rendering process by setting rendering hints.

Use the fgl_report_setRenderingHints function to set the following values.

Optimizing GRV embedded font rendering

You can use the grvRenderToBitmap rendering hint to facilitate the optimization of your report printing. If grvRenderToBitmap is TRUE, GRV renders print pages as bitmaps, which can improve speed on some printers. If grvRenderToBitmap is FALSE, GRV renders print pages using shape drawing commands. The default value is false.

Optimizing for local fonts

You can set your printer to use local fonts instead of embedded fonts (call fgl_report_configureSVGDevice with embedFonts=FALSE). In this case, the font renderer is dependent on the system, and therefore different systems produce different sized output for identical input strings and font parameters. You can use rendering hints to improve the fidelity and the printing speed:

  • svgTextLengthAdjust - Adjusts the glyph width and spacing. The value can be Spacing,SpacingAndGlyphs, or Deactivated. By default, the SVG source documents contain the expected length for each string and adjust the glyph width and spacing.
  • grvUseEmbeddedFontMetrics - If TRUE, embeds the font metrics of the original server side font in the document and then positions each character individually by using the individual advance values from the metrics table. The default value is false.

Optimizing for postscript

If the font is not in the standard 16 Postscript fonts, the text is rendered as outlines, which can be very slow on some printers. For these printers, you can optimize the postscript printing by setting psOptimize to TRUE.

You can also shrink the stream size by setting psOptimizeUseDictionary to TRUE. On some printers, this improves the printer speed.
Note: In some cases, setting psOptimizeUseDictionary to TRUE will worsen the printer speed instead of improving it, so you must test the options to get the best result.

These hints are applicable for the server-side silent printing to PJL printers and Postscript files. They are also available for driver-based printers where the PrinterInfo utility lists the printer as an IPP printer and the document as application/postscript; class="java.io.InputStream.

Example

This sample code sets the svgTextLengthAdjust and grvUseEmbeddedFontMetrics hints:

DEFINE renderingHints om.SaxAttributes
LET renderingHints=om.SaxAttributes.create()
CALL renderingHints.addAttribute("svgTextLenghAdjust","SpacingAndGlyphs")
CALL renderingHints.addAttribute("grvUseEmbeddedFontMetrics","true")

CALL fgl_report_setRenderingHints(renderingHints)