Link to home
Start Free TrialLog in
Avatar of resourcesys
resourcesys

asked on

Set WebBrowser control to print portrait or landscape

Hi all,

I have a simple windows form application to print a web page using the WebBrowser control.

I just need to know one thing, how to set the orientation of the printed page to landscape or portrait.

Any help is appreciated.

Thanks.
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

did u try to set the property using:
printDialog.Document.DefaultPageSettings.Landscape = true/false
SOLUTION
Avatar of RameshS
RameshS
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of resourcesys
resourcesys

ASKER

I tried printDialog.Document.DefaultPageSettings.Landscape but their is no relationship between the printdialog object and the wbebrowser object.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi sedgwick,

No, I am using the WebBrowser.Print() method.

I need to print the web page automatically, without the user having to select any options.

If it makes any difference, the printer is PDFCreator as I am turning the webpage into a PDF document.

Thanks.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
reourcesys, does the dll need to be registered on just your development machine or all user machines?
Hi peteredm,

The application I developed runs only on one computer, the main server, as such, we only registered the .dll on that server.

In short, the .dll would need to be registered on any computer where the application is to be run.

Hope this helps.
Afraid not, for a windows app that could be used on any machine in our organisation (hospital).

Looked into modifying the registry but can only find page orientation for ie5 & 6 not 7 which is what's used here. CSS3 don't work until ie9..

At a loss on this one...
set-up is as below if anyone's got any thoughts

vb.net (v2) windows application
html document in a webbrowser control