Solved

Web Browser Control

Posted on 2013-01-15
10
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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