IMZ220 printing too many paper and special characters

Y Yanis Dalabiras 3 years 7 months ago
6 1 0

Hello all,
I'm a beginner in the world of printing and actually i work with xamarin android.
I work wih xamarin android and i'm trying to print on a printer zebra MZ 220 and IMZ 220 who is the new model i have well understand.
 
I have two problems in fact...
 
1 -When i send some command on a MZ 220 or IMZ 220, for some characters (à, é, ...) the device print a ?
Here is it the command :
 
configLabel = "! 0 200 200 510 1\r\n" //+ "ON-FEED IGNORE\r\n"
                + "BOX 10 10 380 450 6\r\n"
                + "TEXT 5 0 110 20 " + "avisé le :\r\n"
                + "TEXT 5 0 25 120 " + "" + DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year + " à " + DateTime.Now.Hour + ":" + DateTime.Now.ToString("mm") + "\r\n"
                + "TEXT 5 1 25 150 " + "dans la tournée :\r\n"
                + "TEXT 5 1 25 250 " + tourName + "\r\n"
                + "PRINT\r\n";
            return configLabel;
 
and i send this command as this :
 
printerBluetooth.Write(System.Text.Encoding.ASCII.GetBytes(strToPrint));
 
I think i must to configure the printer but i don't know how ?
 
2 - my others problem is only on the IMZ, no problem with the MZ.
When i send several command to the MZ printer the space between each command is correct BUT if i realize the same test on the IMZ the space between each command is HUGUE...
Any idea ?
 
Thanks for your time and your knowledge
Christophe

Please Register or Login to post a reply

1 Replies

Y Yanis Dalabiras

Hi Christophe,
To get non-ASCII characters to print you must encode them correctly.  By default the printer takes code page 1252 character encoding.  This is a combination of how you encode them in Xamarin and in the printer.

Send this command as this :
Encoding encoding = Encoding.GetEncoding(1252);
printerBluetooth.Write(encoding.GetBytes(strToPrint));

You may also need to add the Country command to your format:+ "COUNTRY FRANCE\r\n"

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