Back to Community

Why Product Images Don't Show in Your PDF Invoices and How to Fix It

Content

One of the most common issues users face with the PDF Invoices & Packing Slips for WooCommerce plugin is product images not appearing correctly in the generated PDF documents. This problem can be frustrating, especially when the images display fine in the HTML preview but vanish in the final PDF. Based on community support threads, here are the main causes and their solutions.

Common Causes for Missing PDF Images

1. Image Path Issues

The most frequent culprit is using relative image paths in custom templates. The PDF generation engine requires absolute URLs to locate and embed images correctly.

Problem Code:

<img src="/relative-path-to-image/sign.png" alt="sign">

Solution: Always use full, absolute URLs that start with your website's domain.

<img src="https://yourdomain.com/wp-content/uploads/sign.png" alt="sign">

2. Unsupported Image Formats (AVIF)

The default PDF engine (Dompdf) does not support modern image formats like AVIF. If your product thumbnails are in AVIF format, they will not render and may show as a blank box or an 'X'.

Solution: Ensure your product images are saved in a widely supported format like JPEG or PNG. Alternatively, the 'PDF Invoices & Packing Slips for WooCommerce' team suggests that their mPDF extension natively supports AVIF.

3. SSL Certificate Validation in Local Environments

If you are working on a local development site (e.g., using a .local domain), the PDF engine's strict SSL certificate validation can fail, preventing it from loading images.

Solution: This is typically only an issue in local environments. Testing on a live staging site with a valid SSL certificate is the best way to resolve this.

4. Third-Party Storage Plugins (e.g., Amazon S3)

Plugins that offload media to external services like Amazon S3 can sometimes interfere with the image retrieval process during PDF generation. The function used to get image URLs may return a path that the PDF engine cannot access.

Solution: A custom code snippet may be required to force the plugin to use a specific, accessible logo URL. If you encounter this, searching for support threads related to your specific storage plugin is recommended.

Official Methods for Adding Product Images

If your goal is to add product images to your invoices or packing slips, note that this functionality is not included in the free version of the plugin. According to support threads, the 'PDF Invoices & Packing Slips for WooCommerce' team consistently directs users to their Premium Templates extension, which includes a visual customizer and a 'Thumbnail' block for item columns.

Summary of Solutions

  • For custom templates: Use absolute image URLs (https://...).
  • For AVIF images: Convert images to JPEG/PNG or consider the mPDF extension.
  • For local development: Test image generation on a live server.
  • For advanced needs: Adding product thumbnails requires the Premium Templates extension.

By methodically checking these points, you can usually identify and resolve the issue preventing your images from appearing in your PDF documents.

Related Support Threads Support