简体   繁体   中英

C# print GS1 barcode on network printer

i have created an application which uses a Zebra printer to print a GS1 barcode. Actually it has an Oracle backend which generates a string and c# just passes the data to the printer.

System.Net.Sockets.TcpClient zClient = new System.Net.Sockets.TcpClient();
zClient.Connect(zIP, zPort);
System.IO.StreamWriter zWriter = new System.IO.StreamWriter(zClient.GetStream());
zWriter.Write(zgs1);
zWriter.Flush();
zWriter.Close();
zClient.Close();

Now i need to test the GS1 barcode printing on a "normal" network printer with A4 paper. Can somebody tell me how i can achieve that? In principle i would prefer to generate a string from Oracle and pass it on somehow to the printer through the c# application.

Thank you

EDIT: Thanks for the comments. I do not know how to print/transfer as GS1 code a string received from Oracle, for instance (without quotation marks) "(00)360222014120423545(15)141204(10)4805-397-TR". Form the comments i understand the only way is to render it first as PDF or image and then send it to the printer?If yes, how can i do that? I searched around but didn't really find free solutions. The printer (IP) is fixed.

我已经设法通过使用PrintDocument和.NET dll的Spire.BarCode解决了该问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM