How to convert html to doc in php

I need to convert html file to doc. I am using html2pdf to convert pdf.

Is there any library for html2doc?

(PS must be free / open source)

EDIT

After the comment of Mark Eirich ..

Here are two screenshots. Word document is not aligned correctly. Check y-scroll in a text document. WORD document, check y scroll ..

html file, on browser ..

Body Tag: -

<body style="margin-left:350px; margin-right:350px;">

I tried to tune it, but no effect.

EDIT 2

after the second comment by Mark Eirich, I found out that the word perceives things in pixels not at the age of%. I have the last question in the background. Any help .. please check out two screenshots. The difference is the outer box. and thats y html generated document looks odd.

Original word file

html generated doc file

+5
2

IMO , :

Microsoft Office , , , , od, .

:

, , - , Word , Excel , , , . , Office:

  • .
  • .
  • .

....

:

Word, RTF. , Word, RTF, , , - RTF . Word, RTF, "" . RTF-, Word .

@source: http://www.joelonsoftware.com/items/2008/02/19.html

, :

, winrar;) , , extenstion , Never Tried

+5

Microsoft Word COM ( Windows Office).

$word = new COM("word.application") or die ("couldnt create an instance of word"); 

!. http://php.net/manual/en/book.com.php.

html2doc - html2rtf, , http://paggard.com/projects/rtf.generator/ http://sourceforge.net/projects/phprtf/.

RTF doc

header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=document_name.doc");

, .

rtf , - . HTML , , Word -, :)

+1

All Articles