473,748 Members | 3,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebBrowser Printing

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 can't
figure out how to wire up the OnAfterPrint event (mentioned in the article)
to a method in my C# class so I can detect when it's finished. Does anyone
know how to do this and/or have some sample code that does it?

BTW, does anyone know why MS doesn't have a true .NET web browser control
available? Seems there's plenty of interest by searching nuermous websites
and newsgroups. Being forced to use COM interop just for displaying/printing
some data seems like a waste.

TIA,
--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com
Nov 16 '05 #1
5 7326
N.K
Hi John,

MS doesnt have pure native .NET control in place of webBrowser - not
even sure if they plan to do the same in Whidbey .

If there is one afterPrint event, you can easily wireup to that by
making winform as host of that particular interface.

I will send you some sample code snippet after few hours( if there is
AfterPrint event)

Cheers
Nirmal

"John Bowman" <<Remove this before reply> jo*********@the rmo.com> wrote in message news:<ON******* *******@TK2MSFT NGP11.phx.gbl>. ..
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 can't
figure out how to wire up the OnAfterPrint event (mentioned in the article)
to a method in my C# class so I can detect when it's finished. Does anyone
know how to do this and/or have some sample code that does it?

BTW, does anyone know why MS doesn't have a true .NET web browser control
available? Seems there's plenty of interest by searching nuermous websites
and newsgroups. Being forced to use COM interop just for displaying/printing
some data seems like a waste.

TIA,

Nov 16 '05 #2
About the WebBrowser in Whidbey -
http://www.windowsforms.net/WhidbeyF...ols&tabindex=4
"N.K" <ni**********@h otmail.com> wrote in message
news:5b******** *************** ***@posting.goo gle.com...
Hi John,

MS doesnt have pure native .NET control in place of webBrowser - not
even sure if they plan to do the same in Whidbey .

If there is one afterPrint event, you can easily wireup to that by
making winform as host of that particular interface.

I will send you some sample code snippet after few hours( if there is
AfterPrint event)

Cheers
Nirmal

"John Bowman" <<Remove this before reply> jo*********@the rmo.com> wrote in

message news:<ON******* *******@TK2MSFT NGP11.phx.gbl>. ..
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 can't figure out how to wire up the OnAfterPrint event (mentioned in the article) to a method in my C# class so I can detect when it's finished. Does anyone know how to do this and/or have some sample code that does it?

BTW, does anyone know why MS doesn't have a true .NET web browser control available? Seems there's plenty of interest by searching nuermous websites and newsgroups. Being forced to use COM interop just for displaying/printing some data seems like a waste.

TIA,

Nov 16 '05 #3
Nirmal,

Thanks for the response. The article mentions an "onafterpri nt" event that
needs to be sinked. But the example VB code is useless. So, I beleive it's
there, but how to make use of it?... I'm just too much of a newbie w/
mshtml/SHDocVw at this point.

John

"Andy Gaskell" <pubb AT hotmail DOT com> wrote in message
news:Oh******** ******@tk2msftn gp13.phx.gbl...
About the WebBrowser in Whidbey -
http://www.windowsforms.net/WhidbeyF...ols&tabindex=4

"N.K" <ni**********@h otmail.com> wrote in message
news:5b******** *************** ***@posting.goo gle.com...
Hi John,

MS doesnt have pure native .NET control in place of webBrowser - not
even sure if they plan to do the same in Whidbey .

If there is one afterPrint event, you can easily wireup to that by
making winform as host of that particular interface.

I will send you some sample code snippet after few hours( if there is
AfterPrint event)

Cheers
Nirmal

"John Bowman" <<Remove this before reply> jo*********@the rmo.com> wrote in
message news:<ON******* *******@TK2MSFT NGP11.phx.gbl>. .. 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

can't figure out how to wire up the OnAfterPrint event (mentioned in the article) to a method in my C# class so I can detect when it's finished. Does anyone know how to do this and/or have some sample code that does it?

BTW, does anyone know why MS doesn't have a true .NET web browser control available? Seems there's plenty of interest by searching nuermous websites and newsgroups. Being forced to use COM interop just for displaying/printing some data seems like a waste.

TIA,


Nov 16 '05 #4
N.K
Ah ! Still dont have a clue on how to do this. Please read this
thread, it might be useful.
http://groups.google.com/groups?hl=e...3DN%26tab%3Dwg

I will try on this when i am free, Please post to thread or write to
me if you got a solution !

Cheers
NIrmal

ni**********@ho tmail.com (N.K) wrote in message news:<5b******* *************** ****@posting.go ogle.com>...
Hi John,

MS doesnt have pure native .NET control in place of webBrowser - not
even sure if they plan to do the same in Whidbey .

If there is one afterPrint event, you can easily wireup to that by
making winform as host of that particular interface.

I will send you some sample code snippet after few hours( if there is
AfterPrint event)

Cheers
Nirmal

"John Bowman" <<Remove this before reply> jo*********@the rmo.com> wrote in message news:<ON******* *******@TK2MSFT NGP11.phx.gbl>. ..
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 can't
figure out how to wire up the OnAfterPrint event (mentioned in the article)
to a method in my C# class so I can detect when it's finished. Does anyone
know how to do this and/or have some sample code that does it?

BTW, does anyone know why MS doesn't have a true .NET web browser control
available? Seems there's plenty of interest by searching nuermous websites
and newsgroups. Being forced to use COM interop just for displaying/printing
some data seems like a waste.

TIA,

Nov 16 '05 #5
Nirmal,

Thanks for the post. I read the post below. Unfortunately, it doesn't tell
me anything I haven't already figured out from the article I mentioned. The
link that Jeffry Tan from MS used is to the same article and that doesn't
help me any :(. I appreciate your assistance/persistence.

John
"N.K" <ni**********@h otmail.com> wrote in message
news:5b******** *************** ***@posting.goo gle.com...
Ah ! Still dont have a clue on how to do this. Please read this
thread, it might be useful.
http://groups.google.com/groups?hl=e...3DN%26tab%3Dwg
I will try on this when i am free, Please post to thread or write to
me if you got a solution !

Cheers
NIrmal

ni**********@ho tmail.com (N.K) wrote in message

news:<5b******* *************** ****@posting.go ogle.com>...
Hi John,

MS doesnt have pure native .NET control in place of webBrowser - not
even sure if they plan to do the same in Whidbey .

If there is one afterPrint event, you can easily wireup to that by
making winform as host of that particular interface.

I will send you some sample code snippet after few hours( if there is
AfterPrint event)

Cheers
Nirmal

"John Bowman" <<Remove this before reply> jo*********@the rmo.com> wrote in message news:<ON******* *******@TK2MSFT NGP11.phx.gbl>. ..
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 can't figure out how to wire up the OnAfterPrint event (mentioned in the article) to a method in my C# class so I can detect when it's finished. Does anyone know how to do this and/or have some sample code that does it?

BTW, does anyone know why MS doesn't have a true .NET web browser control available? Seems there's plenty of interest by searching nuermous websites and newsgroups. Being forced to use COM interop just for displaying/printing some data seems like a waste.

TIA,

Nov 16 '05 #6

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

Similar topics

5
7554
by: Noozer | last post by:
I've got a WebBrowser control (AxBrowse - VCMAXB.DLL) and I'm having a few difficulties with it. Just looking for a few pointers, not whole solutions here. I've tried looking at the MSDN help files with little success. - When a new window is trying to pop up, how do I determine the target URL? How can I get the page to open in the current browser control? - When printing from the webbrowser control is there a way to ensure it prints...
0
1698
by: Carl Manson | last post by:
Hi All, I am writing a complex print job solution that requires the printing of many HTML documents in an exactly defined order. Our application uses the IE WebBrowser control to render the documents, then fire them off to the printer. It is all fully automated, so no user interaction is required. However, some documents are larger than others and take longer to spool. The standard behaviour of spoolers/print queues is FIFO, but
2
4779
by: Chris Bingham | last post by:
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...
1
2077
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
2924
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
6376
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
2637
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
11
8717
by: Webbert | last post by:
I am trying to display XML in a WebBrowser Control. I receive a data feed of XML and am trying to inject it into the control. I have not been successful in doing so. The only solution I have found is to write it to a temp file and then use the Navigate method to load it. As the control is capable of loading it from disk, I would like to find a way to skip the save/load and just inject. Thanks, Dave
1
12618
by: Tim Sprout | last post by:
I want to call Page Setup to set default printer and page size and orientation before batch printing pdf's silently from WebBrowser controls. I can print silently using DDE (the NDde library) or Adobe Interapplication Communication (IAC) DotNet API. There is no Adobe DDE command or IAC API for Page Setup. I don't see a print silent method for the WebBrowser control. I can get a Page Setup dialog to appear by using the code below, but the...
0
8987
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
9366
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
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
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
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
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.