Friday, March 3, 2017

Converting a generated HTML file to Doc using PHPWord / PHPDocX in Laravel

So I've been ripping my hair out for hours upon this, reading all the source code and I just can't for the life of me take a html file, turn it in to a word document.

Microsoft Word -> Save as -> HTML

Then upload that to the system I currently have, then put what it can in to a word document and then save on the system && back to the user.

I've tried the PHPOffice\PhpWord\Reader\Html which doesn't seem to do anything other than error, tried looking at the ways it does Word2007/XML and duplicating it with html. I know this question has been asked but I've tried everything people are suggesting and I can't get it to work.

If I can't get PHPWord to work I'll have to shell out £500 for PHPDocx which is stupid cause it's just for one feature.



via Mike Rodham

Advertisement