473,396 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Mar 21 '09 #1
2 7582
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
o o!! its some what critical only... anyway thank u for your valuable suggestion!! :)
Mar 23 '09 #3

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

Similar topics

0
by: prakash | last post by:
Dear Friends I am new guy to Visual C++.NET I've program to save website as a image vc++.net . It have a function "SaveSnapshot" to save the webpage as an image On that function ifor saving...
4
by: teeBull | last post by:
Hi all, We'd like to take advantage of code we already have for transforming XML into HTML (using XSLT) for our users to save the HTML as an MS Word document locally. I've dug around and found...
5
by: JohnSouth | last post by:
Hi I've seen lots of posts around this subject but nothing recent or very helpful. I've an ASP.Net c# application that needs to read Word documents from a directory on the web server, open...
3
by: =?Utf-8?B?YXNkZg==?= | last post by:
Hello. I am making a web application with c# and am using this code: Response.ContentType = "application/x-excel"; Response.AddHeader("Content-Disposition", "attachment;filename=" +...
6
by: eureka | last post by:
Hi friends, I am developing a web application using Jsp and JS. I have a main Jsp page(Jsp1).Inside it I have an iframe having an Html- table which is created dynamically and contains all...
2
by: gusa992000 | last post by:
Hello I am trying the following problem: A web app in jsp and java has to open a microsoft word document directly in the browser. This part is easy and i have done it. The user then can...
1
by: koraykazgan | last post by:
Hi all, I have to solve the following scenario. On my webpage, the user is able to view some text content. I have to put a "Save Document" button on that page. If the user wants to save that...
0
by: ppardi | last post by:
I'm developing an addin for Word 2007 and I need to determine whether a user saves a Word 2007 document in an older format (97-2003) after a save as is done. The scenario is that the user starts...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.