-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Comments
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? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: