Link to home
Start Free TrialLog in
Avatar of vb7guy
vb7guyFlag for United States of America

asked on

Web Browser Control

I have a vb.net application in which I list files from a directly. These file are either gif for html format. I want to add functionality for users to print html file and allow users to save html file as gif (locally). if the file sare gif format, I'm copying them locally.

With regards to printing html file. I'm using web browser control. however, most of these html files are in landscape mode. when I print using web browser control. it simply prints them in protrait mode and cuts of part of the page.  how do I change it print to landscape.  I have seen a solution on http://support.microsoft.com/kb/236777 where I tried to change the orientation but that doesn't work.
Avatar of Roopesh Reddy
Roopesh Reddy
Flag of India image

Avatar of vb7guy

ASKER

I've already seen the solution you provided in the link. which talks about downloading "WebOCHostCSharp.exe".  I can't even download the file. It's not available on microsoft site.
Hi,

Sorry! I didn't check the link! I blindly trusted Microsoft site and driven me nuts!!!

And i saw some inputs in thread - http://stackoverflow.com/questions/6227676/set-the-printer-to-lanscape-for-the-webbrowser-control?lq=1

Hope it helps u...
Avatar of vb7guy

ASKER

I'm printing several documents so I can't be displaying dialog box for each docment.
Avatar of vb7guy

ASKER

I have also tried changing the Registry setting for Internet Explorer printer settings to print to landscape mode.  However, these settings are not save in the registry. this is because once I change the IE setting and goto regirty, All other page setting are save in registry "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup"
I.E. doesn't seems to save this setting.
Hi,

Seems like we have limited options for Web Browser control, especially for printing!

Did you see this MSDN thread - http://social.msdn.microsoft.com/Forums/nn-NO/netfxbcl/thread/89f34354-a370-4358-9c90-6b78b04ce134

Hope it helps u...
Avatar of vb7guy

ASKER

Hi, roopeshreddy
The link you just send talks about changing the Printer setting via registry.  I'm able to change page header, margins and they all work, but for some reasons the Landscape mode doesn't seems to work
For example, I can change the "header" key value in the following registry key to say something like "Test Header". Then use WebBrowser1.print command and the page that I print has the same header as the registry say.  But Landscape property doesn't work.
 HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup


http://social.msdn.microsoft.com/Forums/nn-NO/netfxbcl/thread/89f34354-a370-4358-9c90-6b78b04ce134
ASKER CERTIFIED SOLUTION
Avatar of Roopesh Reddy
Roopesh Reddy
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 vb7guy

ASKER

Thanks. I'm currently working on another project. But, I've that a try.  if not, then I'll reopen the question