3 Replies Latest reply on Jul 24, 2018 10:51 AM by Greg Foote

    [C#] How to create a ZPL from a EMF/PDF byte array

    Alexander Walch

      Hello,

       

      here the background to the question:

       

      In our company we have a webservice from which we can retrieve various labels as a base 64 encoded byte array. The format of the returned array can either be a PDF or an EMF.

       

      The task is to create a valid ZPL string for the returned byte array and store this ZPL string in a database. From there it will retrieved and then send to the printer when required.

       

      What is the easiest way to achieve this?

       

      Within the demo solution of the SDK there is this method which creates a demo file.

      The essential line i think is the following, where the "TEST" is the only real content:

       

      configLabel = Encoding.UTF8.GetBytes("^XA^FO17,16^GB379,371,8^FS^FT65,255^A0N,135,134^FDTEST^FS^XZ");


      Now, would it be sufficient to add the content of the EMF/PDF ase the content of the ZPL string, with changing the commands regarding size and format?

      Is there a possibility to achieve this? Maybe even as easy as sending the byte array to a printer or printer driver and get the formatted ZPL string as result returned?

       

      Cheers,

      Alex