Printing PRN files from C #

I am moving on to converting Visual Basic 6.0 code to C #. The code concerns receiving the pre-generated PRN files and sending them to the printer.

However, I got a little confused about how to do this with C #. I looked at PrintDocument, but I don’t think what to do what I want to do when I am going to send the PRN file directly to the printer (in some cases I need to change the data before sending it to the printer).

In Visual Basic 6.0, we used the following:

intPrinter = FreeFile
Open gstrPrinter For Output As #intPrinter

intFileChn = FreeFile
Open strOverlay For Binary As #intFileChn

Do Until EOF(intFileChn)
    Get #intFileChn, , strDatIn
    Print #intPrinter, strDatIn;
Loop

I am looking for something like this when it either transfers the file or downloads it, and then sends it to the printer.

, xps , WPF, , , Visual Basic 6.0 # .

+3
1

, VB 6.0; # . . .

+1

Source: https://habr.com/ru/post/1715333/


All Articles