Issue Zebra Printer

MaxNunezMaxNunez CRMember ✭✭

I know how to connect and print with my zebra printer from Xamarin, but I don't how to send the instructions to change the font. In the other words, I would like to know how to change the style font (eg. Bold) and size font. I checked the documentation from printer web site, but didn't find a way how to send the instructions.

Best Answer

  • DaveHuntDaveHunt US ✭✭✭✭✭
    edited August 2013 Accepted Answer

    The MZ320 uses CPCL (and emulates EPL). You should use something like:

    ! 0 200 200 210 1 TEXT 4 0 30 40 Hello World FORM PRINT

    (make sure each line ends with both CR and LF)

    I'm not sure if you need the ASCIIEncoding stuff or not. I would try it without first.

Answers

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    What is the printer model? Different Zebra printers support different command sets (ZPL, EPL, SGD).

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    For printers that support ZPL, see ZPL Programming Guide

    For printers that support CPCL, see CPCL Programming Manual

  • MaxNunezMaxNunez CRMember ✭✭
    edited August 2013

    Yes, I saw this guide but my issue is when I try to send the instructions because I was sending the data by strings but the printer doesn't recognize it. The printer prints the commands that I'am sending.

    For example:

    string instruction= "^XA^FO50,50^ADN,36,20^FDhelloword^FS^XZ";

    byte[] bytBuffer = System.Text.ASCIIEncoding.GetEncoding(0).GetBytes(instruction);
    strmOutputStream.Write(bytBuffer,0,bytBuffer.Length);

    In this case it must to print something like that

    hello world

    Finally, the model printer is MZ320

  • DaveHuntDaveHunt USMember ✭✭✭✭✭
    edited August 2013 Accepted Answer

    The MZ320 uses CPCL (and emulates EPL). You should use something like:

    ! 0 200 200 210 1 TEXT 4 0 30 40 Hello World FORM PRINT

    (make sure each line ends with both CR and LF)

    I'm not sure if you need the ASCIIEncoding stuff or not. I would try it without first.

  • MaxNunezMaxNunez CRMember ✭✭

    Thanks for your help @DavidHunt I will prove your suggestion.

  • Walid.3746Walid.3746 USMember

    Where can i find sample code for zebra printing using xamarin.android?

  • MaxNunezMaxNunez CRMember ✭✭

    I didn't find examples about that, but you can check API Android Bluetooth to develop some applications.
    http://developer.android.com/guide/topics/connectivity/bluetooth.html

  • Walid.3746Walid.3746 USMember

    I did binding to ZSDK_API.jar file to be able to use it in my XAMARIN project, but i still have some methods that i can't reach. For example: ZebraPrinter and ZebraPrinterConnection.
    How did you manage to get their references in order to print?
    I was able to connect to the printer since a reference to BluetoothPrinterConnection is available after binding, and i got the printer status, but i can't print yet.
    Any help?

  • Walid.3746Walid.3746 USMember

    this issue is still pending, please anyone can help me here?

  • ChristerJensenChristerJensen DKMember ✭✭

    Hi Walid.3746, have you found anything explaning how to print with Zebra device from a Xamarin solution? I'm going through the same now

  • Hello MaxNunez can you solve this?

    Today I have the same problem...

  • ChristerJensenChristerJensen DKMember ✭✭

    Sad that nobody shared how they managed to use Zebra from a Xamarin project here.. I'll keep searching

  • STFSTF SEMember

    @ChristerJensen Any updates? I'm about creating a nuget for iOS and Android for the Zebra communication..

Sign In or Register to comment.