claudep/swiss-qr-bill

generate only QR code as png

aloistr opened this issue · 3 comments

How could I generate only the QR code as a png image, not the whole print form?

There is no way to do it by command line.

If you use the lib from Python, you could however create a QRBill instance (see README), then calling the qr_image() method to obtain a SVG object (calling save(buffer_or_path) on this result), and then convert this SVG to PNG.

Or you could just call qrcode.make(bill.qr_data(), <other make kwargs>) yourself. See https://github.com/lincolnloop/python-qrcode for more details about python-qrcode.

Could you get motivated somehow to add this capability to the command line interface?
I am not strong in python.
I use a C library with cairo backend to create bills as pdf, and prefer to print the rest of the form myself, except for the qr code image. The whole payment form as svg is not convenient for us.

Sorry, it's not in my short-term goals. But it should not be very hard to find someone cooking that for you, hopefully.