PHP Convert Html to Word Format


Hi,

For change html code into word .doc file in PHP we can use “application/vnd.ms-word” header type.

header(“Content-type: application/vnd.ms-word”);
header(‘Content-Type: application/force-download; charset=UTF-8’);
header(‘Cache-Control: no-store, no-cache’);
header(‘Content-disposition: attachment; filename=”myword.doc”‘);

Then After this code u can add Your html or php code.
It will convert your html code into Doc file.

Thanks

Advertisements

One response to “PHP Convert Html to Word Format

  1. This code is working but it doesn’t download any image and on changing the page view in word to print layout it become suffle what should i do now?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s