I need to save HTML documents in memory as Word .DOC files.
Can anybody give me some links to both closed and open source libraries that I can use to do this?
Also, I should edit this question to add the language I'm using in order to narrow down the choices.
If you are a Microsoft Word user, you can still edit HTML files in Word, just as you would any other text-based file. This permits you to directly edit and change a HTML file without the use of a more expensive Web authoring tool.
Try using pandoc
pandoc -f html -t docx -o output.docx input.html
If the input or output format is not specified explicitly, pandoc will attempt to guess it from the extensions of the input and output filenames.
— pandoc manual
So you can even use
pandoc -o output.docx input.html
just past this on head of your php page. before any code on this should be the top code.
<?php header("Content-Type: application/vnd.ms-word"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("content-disposition: attachment;filename=Hawala.doc"); ?>
this will convert all html to MSWORD, now you can customize it according to your client requirement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With