Skip to content
New issue

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

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

Open
rajeshbabu54 opened this issue Oct 28, 2015 · 7 comments

Comments

@rajeshbabu54
Copy link

rajeshbabu54 commented Oct 28, 2015

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! We accept bounties via Bountysource.

@atakajlo
Copy link

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

@GoldenRocking
Copy link

I have resolved this problem...

@atakajlo
Copy link

@GoldenRocking Can you share your solution?

@GoldenRocking
Copy link

No problem!

@DarthLegiON
Copy link

@GoldenRocking can you share your solution right here?

@Paperclip-Systems
Copy link

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
Copy link

nvggit commented Jun 5, 2017

Guys can anyone share solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants