PHP Classes

table and images still messed

Recommend this page to a friend!

      PHP Word DOCX to HTML with Images  >  All threads  >  table and images still messed  >  (Un) Subscribe thread alerts  
Subject:table and images still messed
Summary:Thank you for this, but formatting and images not working proper
Messages:4
Author:Sujan
Date:2020-10-12 11:05:01
 

  1. table and images still messed   Reply   Report abuse  
Picture of Sujan Sujan - 2020-10-12 11:05:01
Images:
I am getting the below error for all images. Not sure

Not allowed to load local resource: file:///C:/xampp/htdocs/Bulldog/tmp/rId8.jpeg

The tables are getting repeated - without the borders and the colors are not coming up at all
This is my code that pulls the docx. Maybe something to do with the encoding?

require_once('wordphp.php');
$rt = new WordPHP(true, 'utf8');
$text = $rt->readDocument('test.docx');
echo $text;

  2. Re: table and images still messed   Reply   Report abuse  
Picture of Rohit Arya Rohit Arya - 2020-10-12 12:24:34 - In reply to message 1 from Sujan
Hi,
For Image issue please replace line number 255 in wordphp.php
//$fname = $this->tmpDir.'/tmp/'.$relId.'.'.$ext;
$fname = 'tmp/'.$relId.'.'.$ext;

and for table try other formatting option.

  3. Re: table and images still messed   Reply   Report abuse  
Picture of Sujan Sujan - 2020-10-12 14:09:05 - In reply to message 2 from Rohit Arya
Hi
The update for image is working. Thank you.


However I do not understand what you mean by other formatting for the tables. The docx I am generating is from here http://www.phpclasses.org/package/8247-PHP-Create-Microsoft-Word-documents-from-templates.html

I however now need to send this docx generated from above as body from phpmailer

  4. Re: table and images still messed   Reply   Report abuse  
Picture of Rohit Arya Rohit Arya - 2020-10-13 06:34:11 - In reply to message 3 from Sujan
as example given this class revert htmlcode and put it in a variable you can directly put it into body of phpmailer.
For formatting option
$text = $rt->readDocument('sample.docx');
call documentread function like above.