PHPWord
PHPWord copied to clipboard
Problem to move from HTML editor (WYSIWYG) a word
I have trouble going from HTML editor (WYSIWYG) to word possible what I want?
I'm trying Sample_26_Html.php Decompose Shared \ html and has no support for "
" "" </ span>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Yes. We can't parse <span>
right now. PHPWord's HTML parser is quite new (#231), so we're going to put this as a to do. If you have time, you can tweak the code and submit to us as pull request. Thanks.
there are also problems with br
I am also seeing formating problems with the HTML importer. If I have some extra time I might pick up some of this work. I have also submitted a patch for the HTML importer where it wasnt working for me at all under PHP 5.3. See #270
I should also note that I have been having good success in using htmltodocx (https://htmltodocx.codeplex.com) instead of the built in HTML importer. It produces better results and only requires minor tweaks to get working with the latest version of PHPWord (name space stuff)
I am working with laravel 4.1, install following the steps https://github.com/PHPOffice/PHPWord, as I can use (https://htmltodocx.codeplex.com/) Might give me a small example?
I will see if I can whip something up when I get in to the office tomorrow.
I would greatly appreciate it
Ok here is an example a threw together, It isn't tested but you should get the gist. hah
https://gist.github.com/bskrtich/6c3cec68eacd3fb3012e
Nice. Thanks @bskrtich . So, shall we "adopt" htmltodocx
like we adopt PclZip
?
Thank you @bskrtich for your proof of concept work. It's great to see, and be able to see, the development of PHPWord and the use of pre-existing and stable projects. :smile:
@ivanlanin Normally, with the HTML Reader we should export a DOCX equivalent. No ?
@Progi1984 What I was thinking is to adopt some algorithm of htmltodocx into our infant HTML Reader.
It would be nice to be able to pull in some code form this project to beef up the HTML reader.