12 Replies Latest reply on Jul 15, 2015 9:56 AM by Beverly Vinson

    Load font to Zebra Printer iMZ320 using CISDFCRC16

    Nydia Zildjiani

      Hi,

       

      I'm developing an app for iOS that will have printing function on it. But then I need to load a Chinese Character to the printer. And I cannot do this by using Zebra Utilities, because it could be more than one printer later. I need to load the font to the printer when it first connected and detect whether the printer have this font or not. There are fews of some related articles about using CISDFCRC16 to load the font. But found out, the font need to be in .CPF format, and it can be done but only using Label Vista, but Label Vista can only run on Windows XP. Does anyone have any suggestion on how I should handle this?

       

      Thanks,

        • Re: Load font to Zebra Printer iMZ320 using CISDFCRC16
          Daniel Quagliana

          Nydia,

          There is a sample code article in the Zebra Support Portal for a tool that I believe will meet your needs.  It not only can convert and create a CPS file, but has methods for creating a downloadable header.  The tool and code can be found here: Font Conversion Demo - C++

          There is also an article with more details on using Asian fonts that I think has some helpful information: Printing Asian Fonts – EZ320 – CPCL

          Let me know if this addresses your issue.

            • Re: Load font to Zebra Printer iMZ320 using CISDFCRC16
              Nydia Zildjiani

              Hi,

               

              Thank you so much for your answer. I did check and follow instruction inside Font Conversion Demo - C++ . But after done the whole process, I couldn't find any .CPF file inside the directory. I've double checked the file directory name and everything. Have you ever tried this Font Converter before?

                • Re: Load font to Zebra Printer iMZ320 using CISDFCRC16
                  Manuel Caicedo-Rivera

                  Hi Nydia,

                   

                  You do not need to have Label Vista. After you have converted your font by using the "Font Conversion Demo - C++". Now, you are ready to use the first command you mentioned. CISDFCRC16.

                   

                  ! CISDFCRC16
                  <crc> // 4 digit hex CRC. Enter 0000 to turn off CRC check.
                  <filename> // file name with extension. 8.3 filenames only.
                  <size> // eight digit hex file size in bytes.
                  <checksum> // four digit hex checksum. Enter 0000 to turn off checksum validation.
                  <data> // Binary data to store

                   

                  The command will allow you download this "cpf" file to the printer. It is important to turn off the CRC check by entering 0000 as the format above says.

                   

                  For more information about the command, please go to the link below. (Pag 672 of the new ZPL manual)

                   

                  https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf

                   

                  Please, let me know if this solved your question, or if you need more assistance.

                   

                  Thanks,

                   

                  Manuel Caicedo

                    • Re: Re: Load font to Zebra Printer iMZ320 using CISDFCRC16
                      Manuel Caicedo-Rivera

                      Hi Nydia,

                       

                      Regarding the Font Conversion Demo C++. I downloaded and tested it today.

                       

                      Please, go to debug folder like it is shown below, and run the FontConverter.exe from there.

                       

                      C:\Program Files (x86)\CPlus_FontConversionDemo\Debug\FontConverter.exe

                       

                      The files created will be saved in the same folder

                       

                      C:\Program Files (x86)\CPlus_FontConversionDemo\Debug\

                      2015-05-12 18_27_13-Debug.png

                      Follow the next steps, once you have the window below, choose Add Downloadable Header, and the program would add the command "CISDFCRC16" for you.

                      2015-05-12 18_21_01-FontConverter.png

                       

                      2015-05-12 18_29_29-C__Program Files (x86)_CPlus_Plus_FontConversionDemo_Debug_Cam10pt.cpf - Notepad.png

                      Please, let me know if you need more assistance,

                       

                      Thanks,

                       

                      Manuel Caicedo

                        • Re: Re: Load font to Zebra Printer iMZ320 using CISDFCRC16
                          Nydia Zildjiani

                          Hi All,

                           

                          Sorry that I just able to reply all the comments. Thanks Manuel, I already found the .CPF file. But now, I still trouble to send the file to the printer. My printer iMZ320 is using ZPL language.

                           

                          I've followed the format as below,

                           

                          ! CISDFCRC16

                          <crc> // 4 digit hex CRC. Enter 0000 to turn off CRC check.

                          <filename> // file name with extension. 8.3 filenames only.

                          <size> // eight digit hex file size in bytes.

                          <checksum> // four digit hex checksum. Enter 0000 to turn off checksum validation.

                          <data> // Binary data to store


                          But every time I check the printer, i couldn't find the font inside E: directory or other directory. Wonder is there any part or step that I missed. I did check the manual from pdf as well, but still with no luck

                           

                          Thanks,

                          Nydia Zildjiani

                            • Re: Re: Load font to Zebra Printer iMZ320 using CISDFCRC16
                              Robin West

                              Hi Nydia,

                              I have to check the basic question.  Did you specify a drive in the !CISDF command?  Like this:

                              ! CISDFCRC16

                              0000

                              E:MYFILE.CPF

                              <size> // eight digit hex file size in bytes.

                              0000

                              <data> // Binary data to store


                              Otherwise I believe it assumes R: drive.  Also, can I ask why you are loading a CPF file?  It's usually a CPCL font file format. You won't be able to use it in your ZPL formats.  You need a FNT or TTF file for ZPL.

                                • Re: Re: Load font to Zebra Printer iMZ320 using CISDFCRC16
                                  Nydia Zildjiani

                                  Hi Robin,

                                   

                                  Thanks for your answer. Yes, I didn't specify the drive inside CISDF command. Okay, so seems like I misunderstood on what font that can be load to printer if using CISDF command.

                                   

                                  Now, I already specified the driver. Also I'm using TTF file format. But when I check inside the printer, I still couldn't find the font.

                                   

                                  For the last command:

                                   

                                  <data> // Binary data to store

                                   

                                  How to send this binary data to the printer? Currently the way I'm sending is by using below command:


                                  var fileBytes = File.ReadAllByte ("AppResource/SIMSUN.TTF");

                                  string size = String.Format ("{0:x8}", fileBytes.Length);

                                  NSData data = NSData.FromString (@"! CISDFCRC16" + "\r\n 0000\r\n E:SIMSUN.TTF\r\n "+ size + "\r\n 0000\r\n" + fileBytes);

                                  thePrinterConnection.Write (data, out error);

                                   

                                  I'm quite newbie with zebra printer and zpl language. Really appreciate the comments from all of you.

                                   

                                  Thanks,

                                  Nydia Zildjiani

                                  • Re: Load font to Zebra Printer iMZ320 using CISDFCRC16
                                    Nydia Zildjiani

                                    I did convert the bytes to string with following code:

                                     

                                    string file = Convert.ToBase64String (fileBytes);

                                     

                                    NSData data = NSData.FromString (@"! CISDFCRC16" + "\r\n 0000\r\n E:SIMSUN.TTF\r\n "+ size + "\r\n 0000\r\n" + file);

                                    thePrinterConnection.Write (data, out error);


                                    But then it will produce this error:


                                    ERROR - /SourceCache/ExternalAccessory/ExternalAccessory-287/EAOutputStream.m:-[EAOutputStream write:maxLength:] - 282 failed to write because stream does not have space available


                                    Thanks,

                                    Nydia Zildjiani