PHPWord icon indicating copy to clipboard operation
PHPWord copied to clipboard

Loaded word file it's content not saving in pdf.

Open janmoes96 opened this issue 2 years ago • 1 comments

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

janmoes96 avatar Jun 20 '22 11:06 janmoes96

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.

github-actions[bot] avatar Sep 21 '22 02:09 github-actions[bot]