Gaurav Gupta
Gaurav Gupta

Reputation: 19

PDF/postscript or HTML to ZPL(Zebra Printing Language) code

I have a pdf file or the post-script file of that pdf. My Requirement is to convert this file to ZPL code so that my thermal printer can print that. I searched a lot on google but not able to find any solution which can meet my requirements. Please suggest any way forward if you encountered this situation before. Thanks

Upvotes: 2

Views: 5084

Answers (3)

Elton Saunders
Elton Saunders

Reputation: 1278

Another alternative is to purchase a license from Zebra for a Virtual Device that supports printing PDF directly to the printer. Not all printers are supported, but here is a link to more information and a spec sheet:

Upvotes: 1

Elton Saunders
Elton Saunders

Reputation: 1278

First, convert the PDF to a bitmap. Then convert the bitmap to a base 64 string.

Then use ZPL to store the image temporarily on the printer:

~DGR:FILENAME.GRF,2261,17,:Z64:YOURBMPSTRING

Then send ZPL that recalls the image:

^XA
^XGR:FILENAME.GRF,1,1^FS
^PQ1,0,1,Y
^XZ

Then send code to cleanup the image:

^XA
^IDR:FILENAME.GRF
^XZ

You can send the ZPL all at once, I just broke it out here to show each step. The ZPL Manual has more details about the commands used. You might want to read up on ^DG ^XG ^ID. Also, there is a section on base 64 encoding at the end of the manual.

Upvotes: 6

luser droog
luser droog

Reputation: 19484

There is a way you could go which can do this. If you have postscript as you say, then you can interface the postscript operators to capture the output.

This involves quite a bit of programming. The idea is described in the Camelot Paper.

Upvotes: 0

Related Questions