vb6, ZPL, socket printing -
I have done this programming in Java and it works but it does not move to vb6 (and I need to) Actually I need to send data to Zebra printers on the network. I complete process works (no error is reported, but printer does not print. I used it in Java:
Public Zero Print Onions (Arrayist & Lt; Writing & Data;); // // LH X, Y coordinates is the starting position for the starting position / / FO X, Y is the coordinates for starting the current print / / bar by barcode size / BC code 128, the Orientation , Height, // print interpretation line, print over barcode, // check digit // a font type, height and width / fd data start, fs data end string barcode = data array.get (2) + "-" + dataar .Gate (3); Transfer Ip = "^ MTT"; // Thermal Transfer String JPL string = "^ LH5,5" + Transfer type + // sets type to thermal transfer "^ BY2" + "^ MNM" + "^ FO 50,30 "+" ^ ADN, 96,20 ^ FD "+ DataAir 0) + + "+ + Air + Gate (1) +" ^ FS "+" ^ FO 250,130 "+" ^ BCN, 70, N, N, N "+" FD "+ Barcode +" ^ FS "+" ^ FO50,230 "+" ^ ADN, 96,20 ^ FD "+ Barcode +" "+ DatairGate (4) +" ^ FS "; PrtTags (ZPLString); } Public Zero initializeZPL (string printer in) throws IOException {try {// stream objs int port = 9100; Socket sock = new socket (printerin, port); Ostream = New FileOutputStream (printerIn); Pstream = new printstream (sock.getOutputStream ()); } Hold (prior to unknown host exception) {logger.getlogger (ZebarPLV.clash.gatename ()). Logs (level SESEE, ANNEL, X); } Hold (IOException pre) {Logger.getLogger (ZebraZPLView.class.getName ()). Log (Level.SEVERE, null, ex); //} hold (FileNotFoundException e) {// e.printStackTrace (); }} Public Zero PrtTags (string ZPLString) {try {ZPLString = "^ XA" + ZPLString + "^ XZ"; Four [] characters = ZPLString.toCharArray (); Pstream.print (character); // pstream.close (); Pstream.flush (); } Hold (exception e) {e.printStackTrace (); }}
This is vb6:
as a slow buffer () byte as a typical printer string printer = "ZBR3677984" if sock.State = SckClosed sock .RemoteHost = Printer sock.RemotePort = 9100 sock.Connect Me.txtPrice.Text = "Connect" & amp; VbNewLine & amp; Sock.LocalHostName _ & amp; VbNewLine & amp; CSRR (Soc. Remote Port) _ & amp; VbNewLine & amp; CSTR (Sock. Remosthost) Dim ZPL String String JPL String = "^ LH 10, 10" & amp; "^ MTT" & amp; "^ BY2" & amp; "^ MNM" & amp; _ "^ FO15, 150" & amp; "^ ADN, 36, 20 ^ FD" & amp; "Line-1" & amp; "Line 2" & amp; "FS" & amp; _ "^ FO15, 50" & amp; "^ ADN, 56, 40 ^ FD" & amp; "Line3" & amp; "FS" & amp; _ "^ FO100,100" & amp; "^ BCN, 70, N, N, N" & amp; "^ FD" & amp; "Line-4" & amp; "FS" & amp; _ "^ FO15,190" & amp; "^ ADN, 56,40" & amp; "^ FD" & amp; "Line-5" & amp; "FS" & amp; _ "^ FO15, 250" & amp; "^ BCN, 70, N, N, N" & amp; "^ FD" & amp; "Line-6" & amp; "FS" ZPLString = "^ XA" + ZPLString + "^ XZ" ZPLString = "^ XA" + "test" + "^" XZ "redeem buffer (lane (JPL string)) as a byte buffer = JPLL string sock Sandapata buffer and if
I miss some king of the networkstream to print. Is anyone a line of thought? Too much praise
Sending a byte array of your Unicode characters, that is, if ZPLString
was " X
" is available for you R contains 2 bytes; 88 00
.
I suspect that you do not want to use it by using Chararai
, so you need Unicode Should be used with: buffer = StrConv (ZPLString, vbFromUnicode)
.
Comments
Post a Comment