Web Analytics

Fill the form & Get Installation Support

Magento 2 print barcode with unique code in invoice pdf

There are so many third party libraries or extensions that are available for generating/tracking barcodes.

Today I’m going to share with you that how we can easily add unique barcodes in our pdf using Magento default Zend library.

First, you have to create [Vendor Name]/[Module Name]/etc/di.xml in your existing module or create a new module and add the below code:

Then you have to create a plugin file [Vendor Name]\[Module Name]\Plugin\Invoice.php and add the below code:

After creating both files run php bin/magento cache:flush and see any invoice pdf barcodes are printed as below.

Fill the below form if you have any Magento programming need.

    Recent Articles

    Author Info

    Author Image

    Magento Developer

    Hire S. Gorjia

    Get a Free Quote

      /* second popup */

      Connect With Us