QR Code Quick Questions

xycofryx

Member
Joomla: 3.8.8
Fabrik: 3.8.1
PDF: MPDF

1) How do I resize the QR code without sacrificing the quality of the image?
2) Is the QR Code hidden when it renders on the PDF?
 
Although the library we use for generating the code does have parameters for error correction level and pixel size, which both affect the size of the image, we don't currently have any options in the field element to control those, and just call the QRCode::png() function with the defaults, which are the lowest EC level (so smallest), but the largest pixel size (so the largest).

You could experiment with changing those, in the file ...

plugins/fabrik_element/field/field.php

... at line 602 ...

Code:
            QRCode::png($value);

... try changing that to ...

Code:
            QRCode::png($value, false, QR_ECLEVEL_L, 3);

... which should reduce the image size by 25%. The last arg is the pixel size, which can be between 1 and 4. The default is 4.

However, the next time you update Fabrik, those changes would get overwritten. But worth testing, to see if a pixel size of 3 works, and maybe at some point I might add an option to allow you to set that in the field element settings.

I don't think it hides in PDF view.

-- hugh
 
Thanks Hugh!

So "4" is the largest. That would be worth taking note, I was hoping that I can enlarge the size of the QR_code.

I would look into why QR Code is not displaying on my PDF.

Thanks for your time.

--Sam
 
Last edited:
You could enlarge it by increasing the EC level. The options are:

QR_ECLEVEL_L, QR_ECLEVEL_M, QR_ECLEVEL_Q or QR_ECLEVEL_H

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top