Open 50l3r opened 7 years ago
I try whit DOMPDF without results: LINK TO 2ND PDF
$FilePath = APPPATH."media/Documentos/Facturas/Factura ".$FacturaId.".docx";
$FilePathPdf = APPPATH."media/Documentos/Facturas/Factura ".$FacturaId.".pdf";
//DOCX TO PDF
require_once APPPATH.'third_party/phpword/bootstrap.php';
$rendererLibraryPath = PHPWORD_BASE_DIR . '/vendor/dompdf/dompdf';
\PhpOffice\PhpWord\Settings::setPdfRendererPath($rendererLibraryPath);
\PhpOffice\PhpWord\Settings::setPdfRendererName('DomPDF');
$phpWord = new \PhpOffice\PhpWord\PhpWord();
//Load temp file
$phpWord = \PhpOffice\PhpWord\IOFactory::load($FilePath);
//Save it
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord , 'PDF');
$xmlWriter->save($FilePathPdf,);
I execute this code to convert doc to pdf and recieve this empty pdf: LINK TO PDF
Paths are correct