mcgrailm mcgrailm - 5 months ago 30
Perl Question

QR Code generation in shell / mac terminal

I want to create QR codes for a project I'm working on in the resulting qr will be placed in the indesign document. I have found that there is a plugin for indesign but I suspect that requires user interaction.

So I've been search for how to generate the qr using a shell command. I've found things related to php and rails and even coldfusion but none of those will fit the bill on this. I need to generate them using shell command so image events or perl basically anything I can run from the command line that comes with the mac os

thanks for your help.


I wonder if I could call a url using curl or somthing to get one ?


For doing something similar, we use libqrencode.

It's a c library for generating QR codes, but it comes with a command line utility (called qrencode) which lets you generate QR codes from a string, e.g.:

./qrencode -o /tmp/foo.png "This is the input string"

It supports most options you'd probably want (e.g. error correction level, image size, etc.).

We've used it in production for a year or two, with no problems.

I've only run it on linux systems, but there's no reason you shouldn't be able to compile it on Mac OS, assuming you have a compiler and build tools installed (and any libraries it depends on of course).