Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP mPDF QR-Code: How to control the auto-generated QR-Code-border?

Tags:

php

qr-code

mpdf

To meet given requirements, we are asked to alter the auto-generated QR-Code-border. We’ve searched a lot for describing resources and tested a view guesses but ended up with no working solution. Our best shot was simply CSS, but it just adds an additional border and does not replace the element’s default one. We’ve also tried border="0" or border="false" within the calling HTML-snippet, but this has no effect on the actual output. Furthermore, we would be interested in adding attributes like line-width & -style, color, border-radius, padding and so on.

Additional info: To create QR-Codes within the UTF-8 coded HTML we use code snippets like:

<barcode code="Text goes here" size="0.8" type="QR" error="M" class="barcode" />
like image 908
cpu4you Avatar asked Jul 29 '26 11:07

cpu4you


1 Answers

Since v7.0.0 there is a disableborder="1" attribute achieving this.


See Issue #368:

There is currently no way to achieve this with standard mPDF use.

Well…

It's actually a 7-line change in the code allowing use of a disableborder="1" HTML attribute which should make it work as you need. See above.

like image 74
Finwe Avatar answered Aug 01 '26 06:08

Finwe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!