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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pinocchio123
    New Member
    • Mar 2009
    • 6

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

    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
  • secmazec
    New Member
    • Mar 2009
    • 34

    #2
    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:
    Code:
    // head:
    <style>
    <!--
    .style1 { font-weight: bold; text-decoration: underline; font-family: Arial Black; }
    -->
    </style>
    
    // body:
    <font class="style1">Hello</font>
    Saved from Word as Web Page it looks like:
    Code:
    // head:
    <style>
    <!--
     /* Font Definitions */
     @font-face
    	{font-family:"Arial Black";
    	panose-1:2 11 10 4 2 1 2 2 2 4;}
     /* Style Definitions */
     p.MsoNormal, li.MsoNormal, div.MsoNormal
    	{margin:0cm;
    	margin-bottom:.0001pt;
    	font-size:12.0pt;
    	font-family:"Times New Roman";}
    @page Section1
    	{size:595.3pt 841.9pt;
    	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
    div.Section1
    	{page:Section1;}
    -->
    </style>
    
    // body:
    <div class=Section1>
    
    <p class=MsoNormal><b><u><span lang=EN-US style='font-size:18.0pt;font-family:
    "Arial Black"'>Hello</span></u></b></p>
    
    </div>
    You can only wonder what does Times New Roman do in there :))

    Comment

    • pinocchio123
      New Member
      • Mar 2009
      • 6

      #3
      o o!! its some what critical only... anyway thank u for your valuable suggestion!! :)

      Comment

      Working...