Open rajeshbabu54 opened 9 years ago
I had the same problem. Do you find some workaround?
I have resolved this problem...
@GoldenRocking Can you share your solution?
No problem!
@GoldenRocking can you share your solution right here?
Has anyone posted a solution to this problem. I know @GoldenRocking indicated he had a solution, but I have been unable to locate it or resolve it.
Guys can anyone share solution?
I have used the following code
$phpWord = \PhpOffice\PhpWord\IOFactory::load('temp.docx'); \PhpOffice\PhpWord\Settings::setCompatibility(false);
\PhpOffice\PhpWord\Settings::setZipClass(\PhpOffice\PhpWord\Settings::PCLZIP); $phpWord->setDefaultFontName('Times New Roman'); $phpWord->setDefaultFontSize(12); $phpWord->addParagraphStyle('My Style', array( 'spaceAfter' => \PhpOffice\PhpWord\Shared\Converter::pointToTwip(6)) ); \PhpOffice\PhpWord\Settings::setPdfRendererPath('dompdf'); \PhpOffice\PhpWord\Settings::setPdfRendererName('dompdf');
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord , 'Word2007'); $xmlWriter->save('result1.docx', TRUE); unlink('temp.docx');
Original docx Text :
PHP Word PHPWord is a pure PHP library for reading and writing Word, ODT, and RTF files. This file is the source fileto test the read/write capabilites of PHPWord.
PHPWord can apply font formats such asname and size,bold, italics, color, underline, strikethrough,double strikethrough, SMALL CAPS, ALL CAPS,subscript, superscript, or highlighted. You may also notice that there’s one text break (empty paragraph) before this one that can be created also by PHPWord .
Output docx Text :
PHP Word PHPWord is a pure PHP library for reading and writing Word , ODT, and RTF files . This file is the source file
to test the rea d/write capabilites of PHPWord
Please help me to get correct out put of