Forum


Replies: 1   Views: 2040
Issues converting docx files to pdf after inserting variables
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 andrewk_777  · 21-05-2019 - 03:14

i have a documents where i replace a variable:

$docx = new CreateDocxFromTemplate($tmp_file_path);
$docx->replaceVariableByText($params);

it works fine at this step.

next step i convert docx to pdf.

$docx = new TransformDocAdvLibreOffice();
$docx->transformDocument($file['path'], $file_path ,'',['method'=>'direct','debug' => true]);

and thats when the issues happens new lines are instered before and after the variables. i tested the same document without replacing variables and do not experience same issue.

i.e.

Date retained:  2019-05-07  Date retained:  2019-05-07 

Date retained:  2019-05-07 

turns into:

Date retained:
2019-05-07
Date retained:
2019-05-07


Date retained:
2019-05-07

 

Posted by admin  · 21-05-2019 - 07:15

Hello,

Maybe the new data doesn't fit in that position (due to table or other margins) and a line break is automatically added by the DOCX viewer? Please send to DOCX to contact[at]phpdocx.com and we'll check it.

Regards.