473,761 Members | 6,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

6 New Member
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 7599
secmazec
34 New Member
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
pinocchio123
6 New Member
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
4142
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 as a image it uses image.Save method() This image.Save function have two overloaded form's first one is file name
4
1537
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 the following code to include in the code behind: Response.ContentType = "application/vnd.ms-word" Response.AddHeader("Content-Disposition", "inline;filename=someFile.doc")
5
10948
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 them in Word from the client browser, edit the content and then update the document on the server. I can almost do it by pasting the url into the "Save As" location but I
3
6440
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=" + HttpUtility.UrlEncode("あいうえお") + ".csv"); Encoding encoding = Encoding.GetEncoding("Shift-JIS"); Response.BinaryWrite(encoding.GetBytes(csvStr)); Response.End(); It works fine..the data gets saved nicely to an excel file. The user pushes the...
6
2536
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 records from the backend-table . For creating this dynamic table I've used another Jsp(Jsp2) and in Jsp1 I say: <iframe id = "I1" src="Jsp2.jsp" width=320 scrolling="yes">
2
15358
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 modify the word document. If the user 'save' the document (using the Save button of the MS tool bar in the browser) the application has to 'save as' the document on the server, not over writing the openned file but creating a new one.
1
1141
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 document, she clicks "Save Document" and then I have to pop up the Save As Dialog. When the user selects a folder, where she wants to save that file, I need to save that file on the client. The first question is how can I do that in ASP.Net 2.0? ...
0
3750
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 out with a Word 2007 document, saves that document to disk, then saves the same document in an older format If the user saves a doc in an older format, I want to turn off certain features of my add-in. I'm able to trap the save event easily...
0
9522
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9336
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9902
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8770
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.