Webbrowser and Paper Size

vajra918

New member
Joined
May 31, 2006
Messages
2
Programming Experience
1-3
Hello,

This is my first post on this forum, but you all seem very helpful and I look forward to your replies. I have recently started on a pretty simple VB.NET (2.0) app. There is a lot of data manipulation, but that isn't really pertinent.

On one form I have a Webbrowser control that goes to a particular location then the document at that location is modified slightly and printed using the webbrowser's print function. I need to change the printer settings for that webbrowser so that it will print on legal size paper with the smallest margins possible. I have already found a way to modify the margins via the registry but changing the paper size is beyond me.

Also, it can be assumed the default printer is a network printer and that cannot be changed. This seems to prevent me from using winspool.drv... Which was way complicated anyways. I have not been able to find a way to add a printer port programmatically. if that could be accomplished I suppose winspool.drv could be used, but I would like to avoid that.

Thank you in advance for all your help,

Vajra!
 
Spend a few browsing the documentation of the WebBrowser methods http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser_methods(VS.80).aspx

Investigate three of the ones that start with Show... ShowPageSetupDialog, ShowPrintDialog, ShowPrintPreviewDialog. They will all lead the user to be able to change print settings, if she want to in accordance with hardware and available paper. Note that a printer is usually already set by system driver to the default papersize, so these need only be changed by user in special circumstances.
 
JohnH said:
Spend a few browsing the documentation of the WebBrowser methods http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser_methods(VS.80).aspx

Investigate three of the ones that start with Show... ShowPageSetupDialog, ShowPrintDialog, ShowPrintPreviewDialog. They will all lead the user to be able to change print settings, if she want to in accordance with hardware and available paper. Note that a printer is usually already set by system driver to the default papersize, so these need only be changed by user in special circumstances.
Thank you for your quick response.

I have read and re-read the documentation for the control, though nothing quite does what I need it to. You see there is no room for human error here. I need the page settings set programmaticallyand without user interaction. The page setup dialog has all the values listed on it I would like to change, though using sendkeys to do it seems so lame.
 
Back
Top