Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing a text file in C#

9 views
Skip to first unread message

David Cuffee

unread,
Aug 4, 2004, 12:39:21 AM8/4/04
to
I am not having any luck printing a simple text file with PCL codes to my
windows printer. If I have a text file with PCL codes and I want to dump
that file to my default windows printer, how would I do that in C#?

I tried just putting the printDocument1 object on my form and
doing this:

printDocument1.DocumentName = "C:\\Tablerep.prn";
printDocument1.print();

it just prints a blank page every time. But I can open this file up in the
dos EDIT.EXE and print and it prints fine.

This can't be that difficult. The file is already ready to just be simply
dumped to the default printer. Someone please help!

Thanks,
David


Reshma Prabhu

unread,
Aug 4, 2004, 1:05:01 AM8/4/04
to

David Cuffee

unread,
Aug 4, 2004, 1:34:40 AM8/4/04
to
Thanks Reshma,
I think I saw some code just like the link you gave showed but I guess I
was thinking it couldn't be that involved just to send a text file to the
default printer. I guess I was wrong. Each line must be read into a
streamreader. Thanks again.

David

"Reshma Prabhu" <Reshma...@discussions.microsoft.com> wrote in message
news:6A8C154E-E20E-4C62...@microsoft.com...

0 new messages