Solved

Web Browser Control

Posted on 2013-01-15
10
307 Views
Last Modified: 2013-01-25
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.
0
Comment
Question by:vb7guy
  • 5
  • 5
10 Comments
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38782834
0
 

Author Comment

by:vb7guy
ID: 38783830
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.
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38783929
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...
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38783943
0
 

Author Comment

by:vb7guy
ID: 38798983
I'm printing several documents so I can't be displaying dialog box for each docment.
0
 

Author Comment

by:vb7guy
ID: 38798992
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.
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38801614
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...
0
 

Author Comment

by:vb7guy
ID: 38805718
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
0
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 500 total points
ID: 38806526
Hi,

Oops!!!

If the html files are generated by you, then you can try setting the values in CSS!

http://stackoverflow.com/questions/138422/landscape-printing-from-html

Does this make sense?
0
 

Author Closing Comment

by:vb7guy
ID: 38821469
Thanks. I'm currently working on another project. But, I've that a try.  if not, then I'll reopen the question
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question