PHPWord
PHPWord copied to clipboard
Loaded word file it's content not saving in pdf.
Hi there, ` \PhpOffice\PhpWord\Settings::setPdfRendererPath('src/Controller/PhpWord/lib/dompdf/autoload.inc.php'); \PhpOffice\PhpWord\Settings::setPdfRendererName('DomPDF');
$phpWord = \PhpOffice\PhpWord\IOFactory::load($url, 'Word2007');
$dirname = pathinfo($url, PATHINFO_DIRNAME);
$filename = time().'.pdf';
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord , 'PDF');
$test = $xmlWriter->save($dirname.'/'.$filename);
var_dump($test);`
I have this code that allowes me to load a word file. I can see it's content when I dump $phpWord
, it also creates a pdf file. But the content isn't loaded inside. Instead when you open the pdf, it says something about being corrupt, or couldn't load
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue for you, please try to help by debugging it further and sharing your results. Thank you for your contributions.