By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,053 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,053 IT Pros & Developers. It's quick & easy.

how to save a webpage content as word document using php?

P: 6
hi friends,
i want to store the content of webpage as a word document... (copy the content of webpage into a word doc)..

can u help me??

thank you
Mar 21 '09 #1
Share this Question
Share on Google+
2 Replies


secmazec
P: 34
I think understanding of .doc structure is the key in here. Maybe you can google it thanks to OpenOffice, but I somehow doubt it (Microsoft protection).

Also I'd not recommend saving anything like web page in .doc document (like mark, copy and paste) since reverse conversion is very hard (Word ommits tags and creates ridiculous and useless ones).

I think I'll better explain on example:

If in HTML you say:
Expand|Select|Wrap|Line Numbers
  1. // head:
  2. <style>
  3. <!--
  4. .style1 { font-weight: bold; text-decoration: underline; font-family: Arial Black; }
  5. -->
  6. </style>
  7.  
  8. // body:
  9. <font class="style1">Hello</font>
  10.  
Saved from Word as Web Page it looks like:
Expand|Select|Wrap|Line Numbers
  1. // head:
  2. <style>
  3. <!--
  4.  /* Font Definitions */
  5.  @font-face
  6.     {font-family:"Arial Black";
  7.     panose-1:2 11 10 4 2 1 2 2 2 4;}
  8.  /* Style Definitions */
  9.  p.MsoNormal, li.MsoNormal, div.MsoNormal
  10.     {margin:0cm;
  11.     margin-bottom:.0001pt;
  12.     font-size:12.0pt;
  13.     font-family:"Times New Roman";}
  14. @page Section1
  15.     {size:595.3pt 841.9pt;
  16.     margin:70.85pt 70.85pt 70.85pt 70.85pt;}
  17. div.Section1
  18.     {page:Section1;}
  19. -->
  20. </style>
  21.  
  22. // body:
  23. <div class=Section1>
  24.  
  25. <p class=MsoNormal><b><u><span lang=EN-US style='font-size:18.0pt;font-family:
  26. "Arial Black"'>Hello</span></u></b></p>
  27.  
  28. </div>
  29.  
You can only wonder what does Times New Roman do in there :))
Mar 21 '09 #2

P: 6
o o!! its some what critical only... anyway thank u for your valuable suggestion!! :)
Mar 23 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.