Home All Groups Group Topic Archive Search About

Printing from webbrowser control...

Author
15 Sep 2006 3:49 AM
johnb41
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
easy way to print out richly formatted text and graphics... without the
richtext control, and without all the code for manually handling
wrapping, etc.  Just format all the text and graphics with HTML/CSS and
then do webbrowser.print(). :)

Thanks,
John

Author
15 Sep 2006 4:19 AM
Cor Ligthert [MVP]
John,

Can you describe this a little bit more, because at least I am not aware of
a header and a footer in the webbrowser control.

Cor

Show quoteHide quote
"johnb41" <jsbuchm***@gmail.com> schreef in bericht
news:1158292177.931202.106620@d34g2000cwd.googlegroups.com...
> 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
> easy way to print out richly formatted text and graphics... without the
> richtext control, and without all the code for manually handling
> wrapping, etc.  Just format all the text and graphics with HTML/CSS and
> then do webbrowser.print(). :)
>
> Thanks,
> John
>
Author
15 Sep 2006 4:37 AM
johnb41
Sorry!

You know in Internet Explorer, when you print a web page, there is
always a header and footer printed on the page.  By default, the header
shows the page number, and the footer shows the file name and date.

The same is true when you print out the contents of the webbrowser
control.  You add text to the control with webbrowser.documenttext =
"<H1>Sample Text</H1>"  Then the webbrowser.print() command prints the
page (web page) to the printer.

John


Cor Ligthert [MVP] wrote:
Show quoteHide quote
> John,
>
> Can you describe this a little bit more, because at least I am not aware of
> a header and a footer in the webbrowser control.
>
> Cor
>