Solved

Web Browser Control

Posted on 2013-01-15
10
301 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
Comment Utility
0
 

Author Comment

by:vb7guy
Comment Utility
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
Comment Utility
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
 
LVL 23

Expert Comment

by:Roopesh Reddy
Comment Utility
0
 

Author Comment

by:vb7guy
Comment Utility
I'm printing several documents so I can't be displaying dialog box for each docment.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:vb7guy
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now