This project is read-only.

Add image doesn't work?

Feb 28, 2013 at 10:37 PM
Edited Feb 28, 2013 at 10:43 PM
Hello!

I try add image from my site (http://mysite/image.php).
code:
<?php 
require_once '../PHPWord.php';
$PHPWord = new PHPWord();
$section = $PHPWord->createSection();
$section->addMemoryImage('http://mysite/image.php');//<---
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('Image.docx');
?>
Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file Image.docx.' in /PHPWord_0.6.2_Beta/PHPWord/Writer/Word2007.php:158
Stack trace: #0 /PHPWord_0.6.2_Beta/Examples/Image.php(36):
PHPWord_Writer_Word2007->save('Image.docx') #1 {main} thrown in/PHPWord_0.6.2_Beta/PHPWord/Writer/Word2007.php on line 158


When I use: $section->addImage('image.jpg'); script it works.

Can you help me please.
Thanks for your answer.