Support » Plugin: WooCommerce Gift Coupon » Images not showing on PDF

  • How do I fix the issue of no images appearing in the PDFs that are sent?

    Any issues I add to the pdf appear with a grey box and a cross through it saying “image not found, or type not found”

    How do I fix this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Steve


    Hi andantesash,

    U can fix it by changing woocommerce-gift-coupon/includes/mail.php Line 392

    $dompdf = new Dompdf();
    $dompdf->set_option('isRemoteEnabled', TRUE);
    $dompdf->setPaper( 'A4', 'portrait' );

    Nice greets


    • This reply was modified 3 months ago by  Steve.

    Steve, tried this. Didn’t help.
    I use a regular JPG image. PDF keeps saying “image not found or type unknown.”

    Hi Guys,

    I managed to solve this by turning the image into BASE64 code and including it into the PDF.

    What I have done (all changes are in file mail-template.php):
    – I added this code to load the image into base64:

    $woocommerce_gift_coupon_logo_type = pathinfo($woocommerce_gift_coupon_logo, PATHINFO_EXTENSION);
    $woocommerce_gift_coupon_logo_data = file_get_contents($woocommerce_gift_coupon_logo);
    $woocommerce_gift_coupon_logo_base64 = 'data:image/' . $woocommerce_gift_coupon_logo_type . ';base64,' . base64_encode($woocommerce_gift_coupon_logo_data);

    Then I updated the image rendering by deleting

    $email .= '<img src="' . $woocommerce_gift_coupon_logo . '" width="190" />';

    and adding this instead

    $email .= '<img src="' . $woocommerce_gift_coupon_logo_base64 . '" width="190" />';

    I hope this helps someone else than me 😉

    • This reply was modified 2 months, 1 week ago by  Dezzy. Reason: Styling


    How does it work, updating the image rendering? Were do i put that code?

    • This reply was modified 2 months ago by  robbie2505.
    Plugin Author Alberto Perez


    We review that as soon as possible,


Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.