Replies: 2   Views: 2727
Issue with generating pdf from docx with table
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  · 12-01-2018 - 02:56

Whenever I try to render pdf from docx with tables, there's a noticeable difference with the pdf output from the docx generated.
I rendered the docx using `replaceVariableByHTML` and the docx outputs as expected. Here's the html that was added

 /*header and footer*/

 div.contents {
  border-style: solid;
  border-color: black;
  border-width: 1px;

 table, td, tr {
  border-collapse: separate;
  border-style: solid;
  border-color: black;
  border-width: 1px;
  width: 100%;
  vertical-align: text-top;

 tr.main-row {
  min-height: 600px;
  /*margin: 2px;*/

 td {
  /*background-color: cyan;*/
  margin: 2px;

 .img-tags {
  max-height: 100px;

 u {
  text-decoration: underline;
 } {
  color: red;

</style><div class="contents">
   <tr class='main-row'>
         <td colspan="2"><p>Client Name:&nbsp;<span class="red">[Client: Client Name]</span></p>

<p>Client Address: <span class="red">[Client: Client Delivery Address]</span></p></td>
         <td colspan="2"><p>Organization Name:&nbsp;<span class="red">[Account: Organization Name]</span></p>

<p>Organization Email:&nbsp;<span class="red">[Account: Organization Email]</span></p></td>
   <tr class='main-row'>
         <td colspan="4"><p>Engagement Title:&nbsp;<span class="red">[Engagement: Name]</span></p></td>

Could you tell me what's wrong?
I could send the generated pdf and docx. I tried converting the docx using terminal, the issue still exists. Thanks