ScriptX.Services for Windows PC v2.16 and later have support for browser preview of the content to be printed. ScriptX client library v1.11 and later which implement an emulation of the ScriptX.Addon API use this to implement an emulation of factory.printing.Preview() so that users can review the paginated content that will be printed before they commit to paper.
The print preview does not copy and implement the IE print preview window; it uses the native browser print preview function (Chrome, Edge, Firefox). This delivers a familiar experience to the user and enables quick verification of the content before printing. (It is assumed that print preview is not disabled in the browser).
Some functions within the preview work well:
- Selecting the pages to be printed.
- Duplex option (print on one side/both sides).
- Color or black and white printing.
- Selecting a different printer.
However, there are some limitations and caveats within the preview to be aware of:
- Layout functions which require a re-flow (pagination) of the content such as orientation, papersize and scaling do not work well or as might be expected.
- Switching headers/footers on/off does not change the headers/footers applied programmatically.
Finally, the printer selected as default in the preview may not be the printer that was requested programatically.
By default browsers always use the last used printer as the default in the preview. If the printer to use is assumed to be the current default (i.e. it is not set in script) or the printer set in script is always the same then this will be correct.
If the page script does select a printer to use and this may not be the last used printer then the browser must be enabled to use the current system default printer in the preview. This can be controlled by a browser option, or set in the registry or controlled by group policy.
For information on how to do this search for “Chrome PrintPreviewUseSystemDefaultPrinter” or “Edge PrintPreviewUseSystemDefaultPrinter” or, for Firefox search for “print.save_print_settings”