We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Good Morning!
I have a docx, where I do replace the template and need to export to PDF, but when I do export it loses all formatting.
Do I need something more?
$templateCCB = new TemplateProcessor(public_path() . '/template_ccb.docx'); $templateCCB->setValues($sanitizedData); $templateCCB->saveAs(public_path() . '/tmp.docx'); \PhpOffice\PhpWord\Settings::setPdfRendererPath(base_path() . '/vendor/dompdf/dompdf'); \PhpOffice\PhpWord\Settings::setPdfRendererName('DomPDF'); $phpWord = \PhpOffice\PhpWord\IOFactory::load(public_path() . '/tmp.docx'); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'PDF'); $xmlWriter->save(public_path() . '/result.pdf');
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Good Morning!
I have a docx, where I do replace the template and need to export to PDF, but when I do export it loses all formatting.
Do I need something more?
The text was updated successfully, but these errors were encountered: