473,785 Members | 2,327 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 4467
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
7049
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
1801
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
9489
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
10356
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...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
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
9959
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
8988
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...
0
6744
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
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.