473,382 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Printing an HTML document

I am creating a print preview screen that will take information from a
windows application and allow the user to see it as an HTML page. I
have two buttons on that page. A Save As and a Print button. I have
the Save As button working, but can't seem to get the Print button to
work. I want the user to be able to print the HTML page as they see
it, not as xml code. I am using PrintDialog and PrintDocument and
know that I need to create a PrintDocument_PrintPage control, however
I don't know what needs to go into that PrintDocument_PrintPage
contorl. If someone could point me in the right direction I would
greatly appreciate it.

Thanks

Mar 19 '07 #1
1 2663
You really don't want to go that route. If you use a PrintDocument
class instance, you will basically have to render the HTML yourself, and I
don't think you want to do that.

Rather, you will want to have Internet Explorer do it. There are two
options, one will be by loading the HTML through the WebBrowser control, the
other is to invoke IE to do it. For more information, check out the
following archived thread:

http://groups.google.com/group/micro...fa4164de73b37a

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"C#Schroeder" <An***************@gray-research.comwrote in message
news:11**********************@l75g2000hse.googlegr oups.com...
>I am creating a print preview screen that will take information from a
windows application and allow the user to see it as an HTML page. I
have two buttons on that page. A Save As and a Print button. I have
the Save As button working, but can't seem to get the Print button to
work. I want the user to be able to print the HTML page as they see
it, not as xml code. I am using PrintDialog and PrintDocument and
know that I need to create a PrintDocument_PrintPage control, however
I don't know what needs to go into that PrintDocument_PrintPage
contorl. If someone could point me in the right direction I would
greatly appreciate it.

Thanks

Mar 19 '07 #2

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

Similar topics

5
by: java_helloworld | last post by:
I am trying to print from an applet using the Java Print API. If I run the applet on appletviewer then things work fine i.e. I am able to get the print out. If I run the applet on a browser then...
1
by: Gerard Jonker | last post by:
Hello I am busy with a web-based sofware solution using PHP and MySQL. Is it possible to use a HTML document to produce a filled in form on paper without showing this HTML document on the...
7
by: ap | last post by:
Hi, It is a quick question... Is that impossible to print the page(Web Form .aspx file) in client side using GDI+ like PrintDocument pd = new PrintDocument(); pd.print(); As I know it is a...
2
by: cFleury | last post by:
Hello, I am new to ASP.NET and I have to print an invoice from an application written in ASP.NET, I have followed most of the threads in this newsgroup about the dificulties posed by the server...
2
by: ACaunter | last post by:
Hi all, i was wondering if there was a way to directly print a document to the user's printer, without having to download it first... I needed something like a button, and when the user clicks the...
2
by: Jurjen de Groot | last post by:
I'm about to start a new ASP.NET application, this application will generate several types of documents (PDF HTML XML-DOC) wich have to be printed at the client-side... (probably on different...
1
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...
1
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...
12
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...
7
by: Iain Wilson | last post by:
I am pulling my hair out trying to print various objects from a .net web page My apologies for cross posting but I need an answer and my previous post has attracted no interest. ASP.Net 2.0...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.