In this Digital Era, People tend to shop more online at their convenience instead of wasting time in a visit to nearest offline stores and It’s necessary for store owners to provide invoice copy for a purchase they have made. E-invoicing is very helpful for store owners in terms of providing instant invoice copies along with the digital signature, which is not only cost effective & environment-friendly but also helps to build trust among customers.
Default Magento comes with functionality of generating invoices out of the box, but majority of the time, it’s not enough for store owners and they often need the invoice to be customized. One of our Clients came up with invoice customization requirement to add product images in invoice PDF in Magento 2. Showing product name along with product image is very useful to recognize product when there is bunch of products are existed.
Quick Steps to Add Product Images in Magento 2 Invoice PDF
All you need to do is just create one Product image function in Invoice.php file available at below location.
app\code\\\Model\Magento\Sales\Order\Pdf\invoice.php
Happy Coding!
i have tried this . everything is working fine but the image that is showing is inverted.
Confirm that you implemented code properly and product images are uploaded correctly.
i have tried this . everything is working fine but the image that is showing is inverted.
Confirm that you implemented code properly and product images are uploaded correctly.
Hi, in a few invoices, there is an error when I send to print:
ImageType is not a JPG
Could you please help me?
Kindly check the product images in which you are facing the issue. And if it some another images extension then you need to make changes into the above code, so they allowed to print that things here.
how to show image for bundle product. As this code is only working for simple product. Thanks in advance.
Hello sir product name is not comming full lenght its half