I've got a little issue with the "replaceTemplateVariableByHTML" method. When I try to embed images using the "downloadImages" option Word reports "unreadable content" and that the file is corrupted. Word _can_ actually open the files and the content is alright, but the error message makes the user feel uncomfortable.
First I tried the example "examples/intermediate/HTML.php" which uses 'addHTML' method and works fine but does not embed (download) the images.
After that I tried the following code:[code]
$oPHPDocX = new CreateDocx();
$oPHPDocX->addTemplate( $sUploadPath.'/template/Template.docx' );
$oPHPDocX->replaceTemplateVariableByHTML(
'CONTENT',
'block',
'<p>Some Text</p>
<img src="file:///development/PHPDOCX/res/city.jpg" />
<p>Some Text</p>',
array(
'isFile' => false,
'parseDivsAsPs' => true,
'downloadImages' => true,
'wordStyles' =>array(
'<p>' => 'Standard'
)
)
);
[/code]
This code causes the error described above. If I remove the "'downloadImages' => true," line the error disappears. But that's not what I need. I have to include the images in the DOCX file.
I'd be very grateful for some hints. Btw.: I'm using PHPDOCX v3.2.
best regards,
Robert Vogel
[edit]: I've already tried the tipps from this post: [url]http://www.phpdocx.com/help/forum?vasthtmlaction=viewtopic&t=2820.0[/url]