473,412 Members | 2,072 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,412 software developers and data experts.

how to print documents

How to print any document in .NET?
There are PrintDocument and PrinterSettings classes
available in Framework class library but it requires that
we implement a PrintDocument_PrintPage event handler and
we have to write the code to print the document. This
works fine if we have to print simple text but what if we
want to print RTF and DOC format programmatically. In that
case we have to take care of different sizes of font and
embedded images. Is there any other way to print a
document without using PrintDocument and PrinterSettings
classes?
Help required immediately?

Ashish
Jul 19 '05 #1
3 4928
Hi Ashish,

If you need to work with .doc and .rtf, and you have Office available,
you could try using the Office Primary Interop Assemblies, and automating
Word to do your printing for you. You can find the PIAs at:
http://msdn.microsoft.com/library/de...dc_oxppias.asp

-Shawn

--

--------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights
"Ashish" <sh***********@yahoo.co.in> wrote in message
news:2e****************************@phx.gbl...
How to print any document in .NET?
There are PrintDocument and PrinterSettings classes
available in Framework class library but it requires that
we implement a PrintDocument_PrintPage event handler and
we have to write the code to print the document. This
works fine if we have to print simple text but what if we
want to print RTF and DOC format programmatically. In that
case we have to take care of different sizes of font and
embedded images. Is there any other way to print a
document without using PrintDocument and PrinterSettings
classes?
Help required immediately?

Ashish

Jul 19 '05 #2
Hi, My main concern is to make a component which can be used in asp.net
also. I don't to print just doc and rtf format, but that was just an
example. I want to print HTMl also that can have images and all other
kind of stuff. So how can I do that?
Thanks,
Ashish

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
There is no built in componant to print aribrary file formats. You'll need
to either write your own printing classes using the PrinterDocument class,
or find a library that does this for you.

-shawn
--

--------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights

"Ashish Sheth" <sh***********@yahoo.co.in> wrote in message
news:#F**************@TK2MSFTNGP10.phx.gbl...
Hi, My main concern is to make a component which can be used in asp.net
also. I don't to print just doc and rtf format, but that was just an
example. I want to print HTMl also that can have images and all other
kind of stuff. So how can I do that?
Thanks,
Ashish

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4

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

Similar topics

3
by: SpamProof | last post by:
I'd like to be able to print multiple documents are once using vb.net. What is the best way to do this with out having to print each document one at a time via a loop . Can't I send them all to...
18
by: Phil Powell | last post by:
I am trying to print out an HTML document that has MARGINWIDTH set to 1, however, upon printing, HTML table cell contents are cut off, for exmample: <table border="0" width="780"> <tr>...
9
by: trint | last post by:
Instead of just sending one document at a time, I need to send multiple documents as a print job because our laserprinter will only stack and staple one printjob it receives at a time. I need to...
5
by: Sameer Parekh | last post by:
Hello everyone, We are automating a paper based process and hence need to print certain pdf documents through our VB .Net Application. Any ideas how that can be done? Thanks
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
0
by: Bob | last post by:
I need to print a list of .PDF documents in the order that they are submitted. Previously the print queue has taken the documents in an arbitrary order. Does anyone have .NET code that will force...
1
by: matpublic | last post by:
Hi, I'm using reporting services (localreport) to generate multiple PDF reports. These individual reports (documents) need to be printed together using different trays on the printer (Doc A...
2
by: westmids | last post by:
I'm not sure that what I want to do is possible with Access 97, but I hope to be proved wrong: Within Access 97 I have a table with a hyperlink field enabling me to open MS Word 97 documents. At...
1
rsmccli
by: rsmccli | last post by:
Hello. Long time reader, first time poster... Anyway, here is my problem. We are using Access 2002 I have a subform on our FE where you pick a document name from a combobox, then input a...
10
by: S_K | last post by:
Hi, I have a directory full of a number of .PDF files that I need to print. Is there any simple way to do this? Using PdfReader purhaps? Thanks in advance. Steve
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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,...
0
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...

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.