473,609 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing with the WebBrowser Control

Hi everyone,

Does anyone know how to fix the paper orientation depending on the paper size used when printing with the WebBrowser control please?

What I've got is a HTML file, containing 1 big table of data, created by transforming an XML file using a XSLT file I created in InfoPath (didn't have time to learn XSLT!), the resulting HTML file is fine, except I had to fix the column sizes of the table in cm. Because of this, the table will only fit on A4 Landscape or A3 portrait paper (I know that these are the only 2 paper sizes that'll be used).

Ideally I need the WebBrowser to print using the correct orientation, regardless of what printer and paper size the user chooses!
I have come across a couple of example in the MSDN Library, but they all seem to be in 1 of the dialects of C?

Any help or examples anyone can give would be very much appreciated!
Thanks for your time,

Chris
Nov 20 '05 #1
2 4769
* "=?Utf-8?B?Q2hyaXMgQml uZ2hhbQ==?=" <an*******@disc ussions.microso ft.com> scripsit:
I have come across a couple of example in the MSDN Library, but they
all seem to be in 1 of the dialects of C?


Can you post the links to the samples?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Hi Herfried,

I got the links from an article in the MSDN Library (The one that comes on CD with VS 2003.Net) called 'Printing with the Internet Explorer WebBrowser Control', that article has some examples, mostly seem to be some from of C like I said before, it also has a VB6 example project, but VS.Net says it needs VB6 installing before it can upgrade and open that 1!

The links for the article are:

Q140285 HOWTO: Modify Printer Settings by Using SetPrinter at http://support.microsoft.com/support.../q140/2/85.asp

Q167345 HOWTO: Modify Printer Settings with DocumentPropert ies at http://support.microsoft.com/support.../q167/3/45.asp

Q236777 HOWTO: Change Print Settings for Internet Explorer and WebBrowser Control Programmaticall y at http://support.microsoft.com/support.../q236/7/77.asp

Q188271 HOWTO: Print Contents of the Web Browser Control from VB at http://support.microsoft.com/support.../q188/2/71.asp

Thanks for any help you can give, once I've got this bit sorted I'm home free on this one!
Thanks again,

Chris
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7317
by: John Bowman | last post by:
Hi, I've been reading through the threads on using the WebBrowser control in C# app's and how to print it's contents. I've got that much working. However, the big problem is I can't figure out how to detect when the printing is finished. I've read the article "Printing with the Internet Explorer WebBrowser Control" and it mentions some sample code in pwaitvb. This example pretty much useless to me because VB hides the how to do it. I...
3
2006
by: larry mckay | last post by:
I'm trying to programatically print the content that is rendered in an internet explorer control. if do webbrowser.navigate ("http://www.yahoo.com") the content of the webpage appears in the browser control. I'd like to then print the display of the browser control programatically to a printer. does anyone have any code samples that can do this?
3
3718
by: John Peterson | last post by:
Hello all! I'm at my wits end trying to search for what I assumed to be a relatively straightforward task. I have a Web application written in C#, and I have a button on the form that I want to print the current contents of the browser without bringing up the print dialog. At first I thought it was a simple matter to have the button's "onclick" attribute set to "window.print();". However, that always brings up the print dialog box. ...
1
2072
by: eskildb | last post by:
First, please be gently. I am fairly new to the programming world (1.5 years with some expermentation prior to). I have been working on a project that has to print HTML pages with graphics in a unattended automated fashion. I have a webbrowser that is created with code but not seen. I found the below code on the internet. It creates a webbrowser, and specifies the URL, which navigates the webbrowser to the page. When the document is...
1
2892
by: eskildb | last post by:
First, please be gently. I am fairly new to the programming world (1.5 years with some expermentation prior to). I have been working on a project that has to print HTML pages with graphics in a unattended automated fashion. I have a webbrowser that is created with code but not seen. I found the below code on the internet. It creates a webbrowser, and specifies the URL, which navigates the webbrowser to the page. When the document is...
12
6349
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
2
2631
by: johnb41 | last post by:
I'm using .NET 2.0. My form is displaying the webbrowser control, which is displaying some HTML text. When printing with webbrowser.print(), my printout includes the header and footer. How can I remove the header and footer from the print out? Can this be done? If i can suppress the header and footer, i think this might be a really
0
2224
by: nikhilgargi | last post by:
Requirement: I need to provide printing capability in a C# desktop application that I am developing The documents that need to be printed can be in Rich Text Format (RTF) or HTML. Custom application specific headers are to be added in the print out. Problem: The System.Drawing.Printing namespace .Net provides objects and dialogs to take care of basic print tasks. But there is no native support of printing RTF and HTML formats. One would...
18
11284
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing classes, for each of the checked rows in the GridView. This works fine in the Visual Studio 2005 development environment on localhost. But, when I move the page to the web server, I get the error "Settings to access printer...
0
8115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8053
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8557
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8513
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5504
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4007
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.