0

I'm trying to create a PHP program that can convert ZPL (Zebra Programming Language) to PDF. However, I haven't found much information on how to do this directly in PHP. Most of the resources I've come across point me to services like Labelary.

Since services like Labelary can render ZPL, I believe it's possible, but I'm curious about how they are doing it. I wonder if it's a custom implementation or if they're using some specific libraries. Could someone provide some guidance on how to approach this? What would be the first steps? And how long would it take to build this from scratch?

And if not in PHP, in what other language is it possible?

I did some research and found that I need to first parse the ZPL so the PHP application can understand all the ZPL commands for drawing the label. And it also seems like the ZPL needs to be converted into an image first before it can be turned into a PDF. But I’m not sure if I'm correct on this or if there's a better method to handle ZPL in PHP, or perhaps in another language. So far, I haven’t found any specific libraries or tools to implement this directly.

17
  • 1
    "It seems like the ZPL needs to be converted into an image first before it can be turned into a PDF." Not necessarily. Commented Sep 5, 2024 at 7:34
  • @Olivier Could you explain please? Commented Sep 5, 2024 at 7:39
  • 1
    I think Labelary have written their own software, which, by the way, you can get a license to. As far as I know there isn't anything publicly, and freely, available that will do this for you. You could also write something yourself. ZPL is very basic and PDF is well documented. It will take time though. Commented Sep 5, 2024 at 7:41
  • You can parse the ZPL and use a PDF generating library to produce the PDF. You don't need to generate an image for that. Commented Sep 5, 2024 at 7:42
  • 1
    Which ZPL commands do you need? The Python library seems to only support ^GF indeed, which is not very useful... Commented Sep 5, 2024 at 8:37

0

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.