Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Web Browser Control

Posted on 2013-01-15
10
Medium Priority
?
315 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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 1500 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

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…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline

610 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