Have you been facing problems with the PDF documents that your store creates? Then this article is a one-stop solution. You can now fix logos, missing images or character encoding issues in your PDF document with mPDF add-on. WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels plugin comes loaded with dompdf library, which is lightweight and robust. From the dompdf product page, it could be seen that the library supports Dejavu fonts which in turn doesn’t supports scripts such as Arabic and Hebrew. To solve the issue, this library must be replaced with mPDF library which supports a better RTL layout, extensive language support and Unicode languages. The product page of the mPDF library lists the supported languages here.
The below image shows a sample PDF with an encoding issue in Arabic.
Prerequisites
- A WooCommerce store with WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels extension enabled.
- Invoice enabled from the General settings tab.
Steps to Fix logo, image and character encoding issue
- Install and activate mPDF add-on for PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels by WebToffee from the WordPress navigation menu. Click on Plugins > Add New.
- Type mpdf in the search box and select the plugin mPDF add-on for PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels by WebToffee from the result.
- Click on Install now > Activate.
- To switch the library, select Invoice/Packaging > General settings > Advanced. This will display the advanced setting options. In the advanced settings, look for PDF library option and choose mPDF as your default library.
The below image shows a sample Invoice PDF after switching mPDF library.