Forum


Replies: 4   Views: 2537
Can't get html table to format nicely
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 nickweavers  · 07-08-2017 - 08:13

I have just migrated my production server to a new machine running Ubuntu 16.04 and PHP 7.

I discovered the 3.6 version of phpdocx was not compatible  with php 7 so upgraded to the latest version of phpdocx 7.

Before doing this, on my old server the HTML at my URL was converting to word doc just fine and formatting nicely. Now one of the tables in the document doesn't format well.

My php code looks like this:

$filter = "#mros_repayment_only";
$parms = array('isFile' => true, 'parseDivsAsPs' => true, parseFloats => true,  'filter' => $filter, 'downloadImages' => true);
//$docx->replaceTemplateVariableByHTML('BODY', 'block', $preview_url, $parms); // 3.6
$docx->replaceVariableByHtml('BODY', 'block', $preview_url, $parms); // 7.0   

I can't see a way to upload my word doc here for you to see, but the value for preview_url is:

https://www.dealdirectfinancial.co.uk/index.php?option=com_ddfs_backoffice&task=FactFinderLetters.phpdocxLetter&id_factfind=1020448&id_lettertype=1

The problem table has an html id of mortgages_being_repaid.

Can anyone advise?

 

 

Posted by admin  · 07-08-2017 - 08:47

Hello,

We have done some tests and the HTML is transformed fine. Please check that Tidy and mbstring PHP extensions are installed and enabled and try again; please also test transforming the HTML standalone, this is using the embedHTML method instead of a template.

If you still have issues, you can send the DOCX you get to contact[at]phpdocx.com

Regards.

Posted by nickweavers  · 07-08-2017 - 10:58

Hi, thanks for the quick reply. I checked the modules that are installed and tidy and mbstring are included. (I did get a clean report from check.php).

$ php -m
[PHP Modules]
...
mbstring
...
tidy
...

Would you like me to send the just the output docx, or also the input docx template?

Thanks,

Nick

 

 

Posted by nickweavers  · 07-08-2017 - 11:16

Both sent.

Posted by admin  · 10-08-2017 - 14:56

Hello,

As information for any other user interested, the issue came from the DOCX used as template. It was using a custom setting that did some white areas appear. After fixing that custom setting, the table appears perfectly.

Regards.