Optimize the rendering process

You can optimize the rendering process by setting rendering hints.

Use fgl_report_setRenderingHints to set the following values.

Optimizing GRV embedded font rendering

If you set fgl_report_selectDevice("SVG"), 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 GRV local fonts

If you set fgl_report_selectDevice("SVG"), 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

These hints are applicable for the server-side silent printing to PJL printers (see Print a report without a driver using PJL) 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". The device must be specified as either fgl_report_selectDevice("Printer") or fgl_report_selectDevice("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.

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.

Disabling image caching

By default, images are cached per document to improve performance. However, a very long report with many different images can exhaust memory, and you may want to disable image caching in these circumstances. To disable image caching, set the rendering hint pxmlCacheImages to FALSE.


This sample code sets the svgTextLengthAdjust and grvUseEmbeddedFontMetrics hints:
DEFINE renderingHints om.SaxAttributes
LET renderingHints=om.SaxAttributes.create()
CALL renderingHints.addAttribute("svgTextLengthAdjust","SpacingAndGlyphs")
CALL renderingHints.addAttribute("grvUseEmbeddedFontMetrics","true")

CALL fgl_report_setRenderingHints(renderingHints)