Fero
Fero

Reputation: 13315

tcpdf doesn't priting HTML document with image properly - PHP

My code to convert HMTL to PDF using tcpdf.

$html =  '<pre>
          <br/>
          <h3><a href="/node/02" title="View Original Document">aa</a></h3>
          <br/>
          <img width="628" height="674" class="imagecache imagecache-assetimage" title="" alt="" src="http://test/a_image/AssignPage.jpg" />&nbsp</pre>';

    $htm = '<div style="font-size:40px !important;">'.$html.'</div>';
    $pdf->writeHTML($htm, TRUE, TRUE, TRUE, FALSE, '');

Above code prints the following error message:

TCPDF ERROR: [Image] Unable to get image: /path-of-the-image

If HTML does not contains image it is working perfectly.

What to do to resolve this issue ?

Any help will be thankful and grateful...

Thanks in advance..

Upvotes: 2

Views: 3689

Answers (1)

Fero
Fero

Reputation: 13315

Need to provide 777 permissions for cache folder located in tcfdf.

And it works...

thanks...

Upvotes: 4

Related Questions