Replies: 1   Views: 2043
Image file with absolute path not working
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by Jola  · 21-05-2019 - 01:40

I'm successfully converting HTML to PDF via Libreoffice but the absolute path to images are not showing up. Even with downloadImages set to true.

I'm expecting this to load in the generated PDF

<img src="" width="200" height="200" />

How ever I just get a blank area for where the image is suppose to go.

My embedHTML options look like this.

 $docx->embedHTML($html, array('useHTMLExtended' => true, 'downloadImages' => true));

No error in the server side logs.

Not sure what else to try?

I have a premium licence by the way.

Posted by admin  · 21-05-2019 - 07:08


We have run the following script:


require_once 'classes/CreateDocx.php';

$docx = new CreateDocx();

$html = '<img src="" width="200" height="200" />';
$docx->embedHTML($html, array('useHTMLExtended' => true, 'downloadImages' => true));

$docx->transformDocument('output.docx', 'output.pdf');

And the image appears correctly in both documents: DOCX and PDF. Please try this script using the PHP CLI mode, do you see the image in the DOCX document? What version of LibreOffice are you using to transform the document?