imz320 Zebra Designer printing problem

P Panicos Makrides 2 years 11 months ago
13 2 0

 
We have an issue regarding printing and we were wondering wither you would be able to assist for a solution.
 
Firstly, I am using Zebra Designer to create a ZPL II file.
 
Secondly, I’m creating the ZPL file using the “print to file” command.
 
 
 
The main issue is that when the file is sent  to imz320 using  Zebra Setup Utilities with no issues whatsoever,
 
however when the file is sent via C# no printing occurs.
 
 
 
We are using Bluetooth connection in order to communicate with the zebra mobile printer.
 
 
 
Here is a small example of my source code:
 
 
 
ZebraSerialPort port = new ZebraSerialPort("COM4", 115200, 8, Parity.None, StopBits.One, Handshake.None, -1, -1);
 
port.Open();
 
 
 
                    FileStream fs = new FileStream(@"My Documents\zpl1.prn", FileMode.Open);
 
fs.Flush();
 
 
 
int nLength = Convert.ToInt32(fs.Length);
 
BinaryReader br = new BinaryReader(fs);
 
Byte[] bytes = new Byte[fs.Length];
 
bytes = br.ReadBytes(nLength);
 
 
 
 
 
port.Write(bytes, 0, nLength);
 
 
 
Thread.Sleep(2000);
 
Port.close;
 

Please register or login to post a reply

2 Replies

V Vedsatx Saddvv

Hi Panicos,
Is the ZebraSerialPort essentially a C# SerialPort object (System.IO)?  Have you verified the Serial port has been set up correctly on the OS?  I use TeraTerm on my PC to make sure the serial port has been set up by sending "~HI" without quotes and seeing the response.  Printer should respond with printer model number, firmware version, etc.
If so, have you verified the file is being converted to bytes correctly?  I use the code:
     private StringBuilder GetFile(string fileName)
      {
         StringBuilder sb = new StringBuilder();
         if (File.Exists(fileName))
         {
            string[] lines = System.IO.File.ReadAllLines(@fileName);
            foreach (string line in lines)
               sb.Append(newline);
         }
         return sb;
      }
byte [] buffer = convertToBuffer(GetFile(@"My Documents\zpl1.prn"));

If your code is for a mobile device, which one and what IDE are you using?
Robin

P Panicos Makrides

Hello Robin and thanks for your help,

ZebraSerialPort is an object derived from serialport.Is implemented while using zebras sdk.
 
We do print via usb (imz320 connected with usb with a pc) by sending a file which contains zpl script to the printer.
 
Our issue is while trying to send same file via bluetooth connection.Our file is approx 90KB. We sent smaller file and worked.
 
Any ideas?

You can also find attached two prn files, ZPL1 prints fine ZPL2 no printing.

CONTACT
Can’t find what you’re looking for?