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.ActiveDocument.Fields)
{
if (wfield.Type == WordDoc.WdFieldType.wdFieldIncludePicture)
{
wfield.LinkFormat.SavePictureWithDocument = true;
}
}