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
-
[NSFW] PDF Invoice not Fatch Products booking detailshttps://wordpress.org/support/topic/pdf-invoice-not-fatch-products-booking-details/
-
Thumbnail Image in AVIF Not Recognized, White Box Xhttps://wordpress.org/support/topic/thumbnail-image-in-avif-not-recognized-white-box-x/
-
Product Image In PDFhttps://wordpress.org/support/topic/product-image-in-pdf/
-
Display UGS of each product in invoice pdf ?https://wordpress.org/support/topic/display-ugs-of-each-product-in-invoice-pdf/
-
Easily insert featured images into your product listhttps://wordpress.org/support/topic/easily-insert-featured-images-into-your-product-list/
-
REmoving product image from invoicehttps://wordpress.org/support/topic/removing-product-image-from-invoice/
-
Image not showing in custom templatehttps://wordpress.org/support/topic/image-not-showing-in-custom-template/
-
Add product image and brand in packing sliphttps://wordpress.org/support/topic/add-product-image-and-brand-in-packing-slip/
-
Product Thumbnails?https://wordpress.org/support/topic/product-thumbnails-11/
-
Product Images in custom templatehttps://wordpress.org/support/topic/product-images-in-custom-template/
-
PDF Invoice with link to file attachment – Icon covering text.https://wordpress.org/support/topic/pdf-invoice-with-link-to-file-attachment-icon-covering-text/
-
Product picturehttps://wordpress.org/support/topic/product-picture-2/
-
Show Initial Signup fee as a separate billing item in the listhttps://wordpress.org/support/topic/show-initial-signup-fee-as-a-separate-billing-item-in-the-list/
-
Barcode under the logohttps://wordpress.org/support/topic/barcode-under-the-logo/
-
External image on PDF invoicehttps://wordpress.org/support/topic/external-image-on-pdf-invoice/
-
Product images showing in html but not in pdfhttps://wordpress.org/support/topic/product-images-showing-in-html-but-not-in-pdf/
-
Picture for variable productshttps://wordpress.org/support/topic/picture-for-variable-products/
-
Order List Iconshttps://wordpress.org/support/topic/order-list-icons/
-
Adding an image to the packing listhttps://wordpress.org/support/topic/adding-an-image-to-the-packing-list/
-
add spacing for pricing and item meta in pdf invoicehttps://wordpress.org/support/topic/add-spacing-for-pricing-and-item-meta-in-pdf-invoice/
-
Add Download PDF Icon In Order Dashboardhttps://wordpress.org/support/topic/add-download-pdf-icon-in-order-dashboard/
-
Add stamp image to invoicehttps://wordpress.org/support/topic/add-stamp-image-to-invoice/
-
How to place image in footerhttps://wordpress.org/support/topic/how-to-place-image-in-footer/
-
Invoice PDF started showing product weightshttps://wordpress.org/support/topic/invoice-pdf-started-showing-product-weights/
-
How to show (Incl. of all taxes) TEXT in PDF invoicehttps://wordpress.org/support/topic/how-to-show-incl-of-all-taxes-text-in-pdf-invoice/
-
Logo on top righthttps://wordpress.org/support/topic/logo-on-top-right/
-
Want to add custom text for specific product order in the pdf invoicehttps://wordpress.org/support/topic/want-to-add-custom-text-for-specific-product-order-in-the-pdf-invoice/
-
Boxes on product infohttps://wordpress.org/support/topic/boxes-on-product-info/
-
Client tax number not shown in PDFhttps://wordpress.org/support/topic/client-tax-number-not-shown-in-pdf/
-
Item Image inside Invoicehttps://wordpress.org/support/topic/item-image-inside-invoice/
-
PDF product name usedhttps://wordpress.org/support/topic/pdf-product-name-used/