How To Print .prn File Using C#

Posted By admin On 10/05/19

I want to generate barcode PRN File using.net also need to print bar code with printer and generate.prn file on run time. Please let me know soon'. Thanks in advance. Jul 4, 2015 - C# Corner: A global community for developers and programmers. PRN file on USB #Barcode Label Printer by Nikunj Trivedi CC.

I'm in the process of converting some Visual Basic 6.0 code to C#. The code deals with taking pre-generated PRN files and sending these to a printer.

However I'm a little confused as to how to do this using C#. I've looked at PrintDocument, but I don't think that's doing what I want to do as I intend to send the PRN file straight to the printer (in some cases I need to modify the data before it gets sent to the printer).

In Visual Basic 6.0 we used the following:

Open prn file in word

.prn File Viewer

I'm looking at doing something similar where it either streams a file or loads it first then sends this to the printer.

I know I could possibly go down the route of using xps files using the new printing as part of WPF, but ideally I'd like to keep the input files as they are and just change the Visual Basic 6.0 code over to C# which is doing the actual printing.

Rob Mason
How to print.prn file

How To Print.prn File

1 Answer

It's not that straightforward as in VB 6.0; the C# way is a bit lengthy. See Printing Directly to the Printer.

Anand ShahAnand Shah