Forum


Replies: 11   Views: 5092
Problem with inserting image in docx document from embedhtml
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 Mihail Obrazenko  · 22-09-2014 - 12:40

Hello. I use the last trial version of phpdocx library. I trying to make docx document with the image from embedHtml. $header=''; $docx->embedHTML($header, array('isFile' => true, 'downloadImages' => true)); $docx->createDocx('report'); I have the next critical error: Fatal error: Uncaught exception 'Exception' with message 'Permission denied on .' in /var/www/clients/client1/web7/web/sandbox/web/lib/phpdocxTrial/lib/dompdfParser/include/parserhtml.cls.php:307 Stack trace: #0 /var/www/clients/client1/web7/web/sandbox/web/lib/phpdocxTrial/lib/dompdfParser/include/parserhtml.cls.php(875): PARSERHTML->load_html_file('

Posted by admin  · 22-09-2014 - 14:36

Hello, Are you sure you have read access to that image? and that the script can write in the fs? Regards.

Posted by Mihail Obrazenko  · 22-09-2014 - 15:31

Admin, thank for your attention! I try to include to the document image, what located on external web pages. So, yes, i have read access to them. In configuration file i write correct path to the temp dir. And script has access to write in the document destination folder. Also, there are not any warnings in PHPDocX configuration test. http://kombinator.obrazenko.com/lib/phpdocxTrial/check.php Documents without images created successfully. Can you help me to write some test for identify the problem? Any ideas?

Posted by admin  · 23-09-2014 - 08:46

Hello, Please set the image as absolute path and try again. Regards, Jorge

Posted by sureshopensoft  · 04-03-2015 - 07:15

Hello, I have set the image as absolute path after that also i got same error like Fatal error: Uncaught exception 'Exception' with message 'Permission denied on

Paper ID 8507

NUCLEOTIDE DIVERSITY IN EXON 4 AND 5 OF GROWTH HORMONE (GH) GENE IN INDIGENOUS SHEEP BREEDS.

R. Arora .1,D.K. Yadav1 C:\xampp\htdocs\phpdocx\lib\dompdfParser\include\parserhtml.cls.php on line 307

Posted by admin  · 04-03-2015 - 11:26

Hello, Please check and run the included example using the CLI mode, it works perfectly and download external images. Regards.

Posted by sureshopensoft  · 07-03-2015 - 07:53

Every time i want CLI mode? else it is possible run in code itself ....

Posted by admin  · 08-03-2015 - 10:35

Hello, You can use phpdicx with Apache or any other web server, CLI mode... As we don't know how is your script, we recommend you to run the included example that works perfectly and using the CLI mode to isolate external problems like wrong configs, firewalls, SELinux... Regards.

Posted by sureshopensoft  · 10-03-2015 - 11:31

Fatal error: Uncaught exception 'Exception' with message 'Image does not exist.' in C:\xampp\htdocs\phpdocx\classes\AutoLoader.inc(63) : eval()'d code:55 Stack trace: #0 C:\xampp\htdocs\phpdocx\classes\CreateDocx.inc(2168): PhpdocxLogger::logger('Image does not ...', 'fatal') #1 C:\xampp\htdocs\phpdocx\img.php(18): CreateDocx->addImage(Array) #2 {main} thrown in C:\xampp\htdocs\phpdocx\classes\AutoLoader.inc(63) : eval()'d code on line 55 I am using Public url only...but i got error like above mention one my script is: addText('In this first example we just add an image with a dashed border:'); $options = array( 'src' => 'http://wallpapersadda.com/wp-content/uploads/2014/12/wildlife-wallpapers-animals-nature-images-array-wallwuzz-hd-wallpaper-3194-animal.jpg', 'imageAlign' => 'center', 'scaling' => 50, 'spacingTop' => 10, 'spacingBottom' => 0, 'spacingLeft' => 0, 'spacingRight' => 20, 'textWrap' => 0, 'borderStyle' => 'lgDash', 'borderWidth' => 6, 'borderColor' => 'FF0000', ); $docx->addImage($options); $docx->addText('This is a closing paragraph.'); $docx->createDocx('example_addImage_1'); ?>

Posted by admin  · 10-03-2015 - 11:32

Hello, The error is clear: Image does not exist Please check that it exists and the script has read access. What license and version are you usin? Regards.

Posted by sureshopensoft  · 10-03-2015 - 11:35

I am using trial version ....it have read access of image from url ? During conversion of HTML to DOCX i also got error like Exception: Permission denied on ......etc. in PARSERHTML->load_html_file()

Posted by admin  · 10-03-2015 - 11:38

Hello, As the trial doesn't support debug, you can only refer to the error ' Image does not exist'. Please check the included examples and the documentation available. Regards.