Web Development

Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion

Locked

How to print document through C# coding?

By rajkar001 ·
Hi everybody,

Can anybody tell me how to print a document throgh C# coding.
I did using streamreader, but then document is not getting printed as it originally is.Bullets,styles,spaces are different in the print out from that in screen.

then i tried using printdialog, but a blank page is getting printed or the path of document is getting printed instead of data in document.
then i tried copying the document into a rich text box and printed it from there.

I was able to get the printout as normal, but if the document is only of RTF , the coding is working.
the coding fails 4 word documents,pdf documents,etc.

=> Is there any general coding to print any kind of document through C# .

Actually i am developing an application where user when clicks 'print' button,it should be printed.user should not be given a chance to modify printer or page settings,etc.

Thanks & Regards,
Karthik

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums