No styling when converting DOCX into PDF

56
February 11, 2019, at 4:10 PM

I am trying to convert a DOCX file to PDF with PHPWord. When I execute the script it looks like that some style elements are not converted. In the DOCX file I have one image, two tables with border 1px and hidden borders and I am using Tabs.

When I execute the script I get a PDF file without the image, all the Tabs are replaced with Space and all the tables have a border 3px.

Does someone know why I am missing these styles?

Here is my script:

while ($data2 = mysql_fetch_array($rsSql)){
  $countLines=$countLines+1;
  $templateProcessor->setValue('quantity#'.$countLines, $data2['quantity']);
  $templateProcessor->setValue('name#'.$countLines, $data2['name']);
  $templateProcessor->setValue('price#'.$countLines, "€ " .$data2['price'] ."");
}
\PhpOffice\PhpWord\Settings::setPdfRenderer('./dompdf');
\PhpOffice\PhpWord\Settings::setPdfRendererPath('./dompdf');
\PhpOffice\PhpWord\Settings::setPdfRendererName('DOMPDF');
$temp_file = tempnam(sys_get_temp_dir(), 'Word');
\$templateProcessor->saveAS($temp_file);
$phpWord = \PhpOffice\PhpWord\IOFactory::load($temp_file); 
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord , 'PDF');
$xmlWriter->save('result.pdf');  
header("Content-type:application/pdf");
header("Content-Disposition:attachment;filename='result.pdf'");
readfile("result.pdf");
READ ALSO
Connection Failed: php_network_getaddresses: getaddrinfo failed: No such host is known

Connection Failed: php_network_getaddresses: getaddrinfo failed: No such host is known

Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is knownin C:\xampp\htdocs\Hostel-Management-System-master\includes\config

77
How to differentiate data to be read between two tables when username and password is passed

How to differentiate data to be read between two tables when username and password is passed

I am using volley in my mobile development login and instead of one table, I used two

50
Avoid inserting duplicate data in csv with PHP

Avoid inserting duplicate data in csv with PHP

I store data into a csv file by this:

50
Why can't I connect to database in xampp? [on hold]

Why can't I connect to database in xampp? [on hold]

I have read all the answers relating to this issue but i couldn't come up with any solutionI have changed config

51