• Resolved quedao

    (@quedao)


    We made a template that adds product images to the invoice, this template was working fine with version 3.6 but in newer version the image is showing in the html version of the invoice but not showing in the pdf version. Instead we see an error in the pdf “image not found or type unknown” (the image is a jpg and the url provided is absolute).

    Any help appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter quedao

    (@quedao)

    For clarity I attach the code that properly prints the image in html:

    <tbody> <tr class="item-5949">
     <td ><img class="thumbnail" src="https://npjul23.local/wp-content/uploads/2022/12/hack03ctr23-150x150.jpg" /></td> <td class="product"> 
    <span class="item-name">(HACK CTR 03) 2023</span> 
    <dl class="meta"> 
    <span class="item-meta">&yen;46,990</span> 
    </dl> <span class="item-meta"></span> <dl class="meta"> </dl> </td>
    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @quedao,

    It could be related with the SSL certificate. Our PDF engine, dompdf, is quite strict on this, and since your are using a local environment, it could be causing a certificate validation issue.

    That said, you could try passing the image path instead of their URLs using this code snippet:

    add_filter( 'wpo_wcpdf_get_html', 'wpo_wcpdf_convert_urls_to_paths', 10, 2);
    function wpo_wcpdf_convert_urls_to_paths( $html, $document ) {
    	$html = str_replace( trailingslashit(WP_CONTENT_URL), trailingslashit(WP_CONTENT_DIR), $html);
    	return $html;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Product images showing in html but not in pdf’ is closed to new replies.