2

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

3 Answers 3

6

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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:

Comments

0

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.

1 Comment

If you have the specification for ZPL (whatever that is) you could write a Ghostscript device too, its probably easier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.