- Support forum for the EAN and Barcodes for WooCommerce.
June 20, 2022 at 1:23 pm #85215Martin AndersenParticipant
I’m using it with WooCommerce PDF Invoices & Packing Slips plugin and I was wondering if there is a way to adjust the size of the barcode image in the PDF? It’s a bit too big for what I need.
MartinJune 23, 2022 at 12:52 pm #85216Tom AnbinderModeratorPlugin Support
Sorry for the late reply. Not possible at the moment, however, should be quite easy to do. Let me try to add it to the plugin. Will get back to you soon.June 23, 2022 at 10:57 pm #85217Tom AnbinderModeratorPlugin Support
I’ve just sent you the new version (v4.1.3-dev) via WeTransfer.
After the update, please go to “WooCommerce > Settings > EAN > (2D) Barcodes > Compatibility > WooCommerce PDF Invoices & Packing Slips”, and locate new “Content” option I’ve just added. By default it’ set to (for 1D barcodes and 2D barcodes respectively):
That is, now you can customize the barcode output with our
These shortcodes have
hattributes that set the width and height of a single bar element (1D barcodes) or single rectangle element (2D barcodes) in pixels. By default, it’s:
[alg_wc_ean_barcode w="2" h="30"]
[alg_wc_ean_barcode_2d w="2" h="2"]
So, for example, to make 2D barcodes two times smaller, set the “Content” option to:
<div class="ean_wrapper_2d">[alg_wc_ean_barcode_2d w="1" h="1"]</div>
Finally, two more attributes can help you customize the barcode image size –
img_h. These attributes set the width and height of the final image. For example, to make 1D barcodes exactly 100 pixels width, we could use this:
[alg_wc_ean_barcode w="2" h="30" img_w="100"]
I hope that makes sense, and please let me know if you have any questions.
- You must be logged in to reply to this topic.