PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.25k stars 2.69k forks source link

Sample_11_ReadWord2007 docx to pdf error(content breaks after some words) #649

Open rajeshbabu54 opened 9 years ago

rajeshbabu54 commented 9 years ago

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

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27756934-sample_11_readword2007-docx-to-pdf-error-content-breaks-after-some-words?utm_campaign=plugin&utm_content=tracker%2F323108&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F323108&utm_medium=issues&utm_source=github).
atakajlo commented 8 years ago

I had the same problem. Do you find some workaround?

GoldenRocking commented 8 years ago

I have resolved this problem...

atakajlo commented 8 years ago

@GoldenRocking Can you share your solution?

GoldenRocking commented 8 years ago

No problem!

DarthLegiON commented 7 years ago

@GoldenRocking can you share your solution right here?

Paperclip-Systems commented 7 years ago

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.

nvggit commented 7 years ago

Guys can anyone share solution?