Printing a text file in C#

  • Thread starter Thread starter David Cuffee
  • Start date Start date
D

David Cuffee

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top