How to get the PrintPreview window with HTMLRenderer ?

MiServer is Dyalog's APL-based web development framework
Post Reply
User avatar
PGilbert
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

How to get the PrintPreview window with HTMLRenderer ?

Post by PGilbert »

If you do in javascript window.print() in a Chrome debug window you will get the PrintPreview window. However when using the HTMLRenderer, window.print() will go directly to the Print window where you select the printer without any preview.

Is there a way to get the PrintPreview window with the HTMLRenderer ?
User avatar
PGilbert
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: How to get the PrintPreview window with HTMLRenderer ?

Post by PGilbert »

Found it. You need to add the following switch when starting the interpreter: -cef --enable-print-preview and to print directly to the default printer the switch is: -cef --kiosk-printing which does not seem to work when I tried it.

Sometimes we need to print silently to the default printer and sometimes we need to print with a Preview. This can all be done with Print() and ShowPrintPreviewDialog() in the System.Windows.Forms.WebBrowser (ShowPrintDialog() is available also).

Is there a ShowPrintPreviewDialog() methods hidden somewhere in CEF ? Because using start-up switches to select one or the other is not a choice for us.
User avatar
JohnD|Dyalog
Posts: 74
Joined: Wed Oct 01, 2008 9:35 am

Re: How to get the PrintPreview window with HTMLRenderer ?

Post by JohnD|Dyalog »

Hello Pierre,

There doesn't appear to be any equivalent to ShowPrintPreviewDialog in CEF. It looks like the command line option is the only way to do it.

Best Regards
John Daintree.
Post Reply