How To Convert Html File To Word?
Solution 1:
Try using pandoc
pandoc -f html -t docx -o output.docxinput.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
Solution 2:
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.
Solution 3:
A good option is to use an API like Docverter. Docverter will allow you to convert HTML to PDF or DOCX using an API.
Solution 4:
When doing this I found it easiest to:
- Visit the page in a web browser
- Save the page using the web browser with .htm extension (and maybe a folder with support files)
- Start Word and open the saved htmfile (Word will open it correctly)
- Make any edits if needed
- Select Save As and then choose the extension you would like doc, docx, etc.
Solution 5:
Other Alternatives from just renaming the file to .doc.....
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word(office.11).aspx
Here is a good place to start. You can also try using this Office Open XML.
http://www.ecma-international.org/publications/standards/Ecma-376.htm
Post a Comment for "How To Convert Html File To Word?"