Home > Docs > WooCommerce PDF Invoices, Packing Slips and Credit Notes Plugin > Fixing Image Missing Issues in WooCommerce PDF Documents

Fixing Image Missing Issues in WooCommerce PDF Documents

Last updated on December 18, 2023

Adding images, logos, and signatures to WooCommerce documents holds significant importance for enhancing brand identity and providing a professional and personalized customer experience. WebToffee’s free WooCommerce PDF Invoices, Packing Slips, Delivery Notes and Shipping Labels plugin and its premium add-ons like WooCommerce PDF Invoices, Packing Slips, and Credit Notes plugin and WooCommerce Shipping Labels, Dispatch Labels, and Delivery Notes plugin provide the provision to have product images, company logo, and signatures within the documents. However, there may be instances where the product images or logos may be missing from the PDF documents. To solve this issue:

  1. Use WebToffee’s free mPDF add-on.
  2. Add the custom code snippet provided.

Image/Logo Missing issues can occur due to problems with the image size, the absence of an image processing library, permission issues, etc.

The following image shows a WooCommerce invoice PDF document with an image and logo missing issue.

WooCommerce Invoice with image and logo missing issue
WooCommerce Invoice with image and logo missing issue

Before moving on to the solutions make sure that the image/logo missing issue isn’t due to the following reasons:

  1. Absence of image processing library.
  2. An issue with the image size.
  3. Permission issues.
  4. Server request restrictions.

Absence of image processing library

When the WordPress site lacks image processing libraries or when the libraries are not compatible with the uploaded image format then the image/logo missing issues can occur. To solve this ensure that proper image processing libraries are present and also ensure to upload images that are compatible with the library.

An issue with the image size

When the uploaded image size exceeds the server capacity these kinds of errors can occur. So upload images of sizes that are compatible with the server capacity.

Permission issues

Lack of file permission can prevent WordPress from reading files on the hosting server. So to solve this grant access for reading and uploading images.

Server request restrictions

If the images are hosted on an external server, there’s a possibility that the server might be blocking external server requests. To address this get in touch with the server team and discuss potential solutions for unblocking these requests.

If the image/logo missing issue still persists then move on to the solutions below:

1. Using the mPDF add-on

The image/logo missing issue in WooCommerce PDF documents can be solved using WebToffee’s free mPDF add-on. To solve this issue, switch the builtin Dompdf library with the Mpdf library. The detailed steps are given below:

  1. Install and Activate WebToffee’s mPDF add-on.
  2. Navigate to the PDF library option.
  • Pro plugin users:
    1. Navigate to Invoice/Packing > General Settings > Advanced.
    2. Under the Advanced tab, head to the PDF library option as shown below.
Navigating to PDF library
Navigating to PDF library
  • Free plugin users:
    1. Navigate to Invoice/Packing > General Settings > General > Advanced options section.
    2. Under the Advanced options section, head to the PDF library option.
  1. Select Mpdf as the PDF library by clicking on the radio button as shown below.
Choosing Mpdf as the PDF library
Choosing Mpdf as the PDF library
  1. Click on Update Settings and save changes.

The image below displays a WooCommerce invoice PDF document with the image and logo missing issues resolved.

WooCommerce invoice with image missing issue resolved
WooCommerce Invoice with image missing issue resolved

2. Using a custom code snippet

An alternative solution to solve the image/logo missing issue is to use a custom code snippet.

Add the custom code snippet given below to the WordPress site. Add the custom code snippet directly into the active child theme’s functions.php file or use a third-party plugin. To know more about how to add a custom code snippet using a third-party plugin, refer to this article.

The custom code snippet is given below: