3

Is there a way to print from the TEdgeBrowser implementation in Delphi?

In the older TWebBrowser we used the following code that worked:

ControlInterface.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, varIn, varOut);

But the TEdgeBrowser doesn't seem to support this?

Any thought's greatfully accepted.

Zhorov
  • 28,486
  • 6
  • 27
  • 52
Julian
  • 41
  • 2
  • 1
    A possible option is to use JavaScript: `EdgeBrowser1.ExecuteScript('window.print();');`. – Zhorov Nov 09 '21 at 07:55
  • Hi thanks that works, just a shame it presents the printing dialog, I need a silent print method as its for a touch screen application where I don't want users to be able to access things but it will do for now, thanks alot. – Julian Nov 09 '21 at 09:15
  • I find the whole control flawed. For example, the print dialog is central to the control and not to the screen. The page header / control has lost all fine tweaking like we have in IE printing. And as you say, silent printing. Too many limitations. Also, you can close your app whilst the print dialogue is visible. – Andrew Truckle Nov 09 '21 at 17:40
  • Please see related answer about printing options in WebView2: https://stackoverflow.com/questions/62654738/print-functionality-in-webview2-control/62662770#62662770 – David Risney Dec 07 '22 at 18:17

0 Answers0