WebBrowser control: how to rewrite URL property

This is a little special:
I am loading some HTML in string form into the WebBrowser control via the DocumentText property.
Now when I print a page using a PDF printer (Bullzip PDF Printer in my case), it always accepts the url as the document name, which is "near: empty".
Is there a way to change this to a different value, by changing the URL (read-only) property, or by changing the print behavior to use a different text rather than the URL as the filename?

0


source to share


3 answers


There are several options that I am aware of, although my knowledge on the subject is a little out of date.

The first is to change your computer settings in the Internet settings. Whether it is done manually or via a registry change script, this is easy for the developer, but obviously not the best approach from deployment or compatibility angles.



The next approach is to design a custom print template. It's not funny, but probably the most professional approach. As much as I would like to include all the information needed for this approach in this post, it is too much to cover. Here's a good overview and Googling luck from there.

My experience with this was printing from the MS WebControl component used in the .NET 1.1 Winforms application to the Web Super Goo PDF converter component. Your mileage may vary.

+1


source


You can change the header and footer so that the URL property is not printed.



0


source


Try Navigate

to url then reverse it withDWebBrowserEvents::BeforeNavigate

0


source







All Articles