473,796 Members | 2,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#-WEB: Converting Html to .doc or rtf or tiff programmaticall y

2 New Member
Hi, I am working on a project in which I have to present a wysiwyg editor. I have to save this code as .doc, .rtf or .tiff format in server side. I am using C# and this is a web application.

My question is how to convert such an html page (or html code) to one of these formats. Any suggestions on these ? There are many 3rd party tools for this but I couldn't find a free one.
Mar 10 '08 #1
1 4469
coolmanist
2 New Member
Hi, I am working on a project in which I have to present a wysiwyg editor. I have to save this code as .doc, .rtf or .tiff format in server side. I am using C# and this is a web application.

My question is how to convert such an html page (or html code) to one of these formats. Any suggestions on these ? There are many 3rd party tools for this but I couldn't find a free one.
I have found a solution:

1-)Opening html page with word com object as web page.
2-)Save the file as rtf document by changing the saveformat parameter to rtf. That's all.

3-) For the ones who need to embed the pictures to the file instead of reference you can add the following before saveas:

foreach (WordDoc.Field wfield in uyg.ActiveDocum ent.Fields)
{
if (wfield.Type == WordDoc.WdField Type.wdFieldInc ludePicture)
{
wfield.LinkForm at.SavePictureW ithDocument = true;
}
}
Mar 11 '08 #2

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

Similar topics

4
7051
by: Dominic | last post by:
Hi guys, In .NET, how can I convert a HTML file to TIFF efficiently? One possible way is that I can first use word automatation to load the HTML up and then print it to TIFF. Is that right? However, even if it is technically feasible, it can take long time to do the conversion, especially the HTML is complicated. Is there any other more efficient way? Thanks!
3
3800
by: bubbles | last post by:
i have a HTML file and it already has a HTML table and a few rows created by default.. however, i would like to add more rows to this table programmatically may i know how?
1
1802
by: darrel | last post by:
I have two issues: 1) The WYSIWYG content editor we're using for our CMS doesn't truly support xhtml. 2) .net doesn't truly support xhtml my question is if there is a .net library/class/component that can convert from html to xhtml?
1
984
by: Stu | last post by:
Hi, I need to find a method of converting html in to a PDF document on teh server. Can anyone suggest the best way of doing this? Thanks in advance, Stu
0
1056
by: UJ | last post by:
I know this isn't the appropriate place but I was hoping somebody might be able to help. I have a web site that creates html pages for displaying later. I'd like to convert them over to SWF's so that they will size appropriately depending on the screen resolution. Does anybody know of a way to do this programmatically? The real problem is that when I display a jpg, if it's not in the correct aspect ratio, if we resize it it will appear...
6
4774
by: Krakatioison | last post by:
I've seen once program which was able to convert any url to JPG file. Once I tried it on cnn.com website and it created the nice jpg, even that the page was scrollable, so it was not using printscreen or anything like that. Any idea how these things get done? K.
9
6737
by: anupamjain | last post by:
Hi, After 2 weeks of search/hit-and-trial I finally thought to revert to the group to find solution to my problem.(something I should have done much earlier) This is the deal : On a JSP page, I want to grab a URL and parse /change the HTML and send it to the JSP page. I take the URL from the user in a textbox (not the
3
2130
by: varuna | last post by:
Hi, I have doubt on converting html page to .net i mean if i designed a page in frontpage or in a Dreamweaver so that page i mean instead of designing a web page in .net using toolbox i need to convert this html page as a .net web page. How to do that shal i open the html file in a .net or shal i copy the file into that folder, im confusing with that so please let me know and explain me briefly. Thanks in advance Varuna
1
2134
by: Software Engineer | last post by:
Testing htmlspecialchars() PHP Function - Converting HTML Characters http://sqa.fyicenter.com/Online_Test_Tools/Test_htmlspecialchars_PHP_Function.php When data needs to be presented in Web pages, HTML special characters must be well protected Otherwise, data well not be presented properly, or the Web will become corrupted. This page allows you to learn and test the htmlspecialchars() function to protect embedded data in Web pages.
0
9685
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
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,...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10201
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
10021
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
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, and deployment—without 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...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5454
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...
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.