Home > Back-end >  c# Print from the printer using usb Cable, without using ip address or shared printer
c# Print from the printer using usb Cable, without using ip address or shared printer

Time:01-20

I'm looking for how to print from the printer without using an IP address or sharing the printer.

i am using the code below and i used the ip address \127.0.0.1\Citizen_CL-S700 for the printer but now i need to print without share the printer or use usb cable

StreamWriter writer = new StreamWriter(PrintFolder   @"\MEFU_"   Cmb_Serial_Print.Text   ".prn", true);
                        writer.Write(content);
                        writer.Close();

                        File.Copy(PrintFolder   @"\MEFU_"   Cmb_Serial_Print.Text   ".prn",\\127.0.0.1\Citizen_CL-S700);

CodePudding user response:

Usage:

 using RawPrint;

    // Create an instance of the Printer
    IPrinter printer = new Printer();

    // Print the file
    printer.PrintRawFile(PrinterName, Filepath, Filename);

Installation:

To install Raw Print, run the following command in the Package Manager Console

PM> Install-Package RawPrint
  •  Tags:  
  • Related