Issue with WebBrowser

cbreemer

Well-known member
Joined
Dec 1, 2021
Messages
184
Programming Experience
10+
I have a little issue with the classic WebBrowser (not the WebView2 one, which I could not get to work).
When I load some html in the WebBrowser by setting the DocumentText property, and then call the Print() method, the name of the printed document is always about:blank. When I first write the html to a file, then load the in the WebBrowser by setting the Url property, then print that, the name of the printed document is the URL of the file. In both cases, I would have expected to see the value of <title> which I have set in the html. Which is actually what the Chromium CefBrowser does.

Incongruously, when I query the DocumentTitle property after setting the Url property, it DOES show the value from the <title> in the HTML. So the component is clever enough to parse the HTML data and find the title, byt not clever enough to use that for the print document name.
Would there be a possibility to set the name of the print document short of writing my own print driver ?
 
Back
Top Bottom