I have hosted my site in remote machine. I can able to access that site in any machine through online link (ex: xyz.mysite.com). I need to print a label from that online site. I have write a below code to print a label (Used Neodynamic thermal SDK library in my application).
var pj = new PrintJob();
PrinterSettings myPrinter = new PrinterSettings();
myPrinter.Communication.CommunicationType = CommunicationType.Network;
myPrinter.Communication.NetworkIPAddress = System.Net.IPAddress.Parse("127.0.0.1"); // Used my local network IP address.
myPrinter.Communication.NetworkPort = 9100;
myPrinter.UseDefaultPrinter = true;
myPrinter.ProgrammingLanguage = ProgrammingLanguage.ZPL;
pj.PrinterSettings = myPrinter;
pj.Print(myLabel);
When I perform print action in web site, facing below error,
An exception occurred while getting the default printer. Win32 error: The system cannot find the file specified.
Can anyone suggest me to resolve this issue?
i develop a websockt for this cases ZPLwebSocket
show the messages of server
this is javascriptcode on page.
this is the socket code c# for run on ConsoleApp:
the RAWPrinterClass link: