So I am trying to convert a HTML file to RTF.
It does convert and display it properly.
But in another part of the program I have to convert it into a PNG image where I only have the RTF file and not the HTML.
So when I load this rtf file, that gives me error.
- Code: Select all
public void Convert(string htmlString, string filePath)
{
var doc = new Document();
doc.LoadHTML(new StringReader(htmlString), XHTMLValidationType.None);
doc.SaveToFile(filePath, FileFormat.Rtf);
doc.LoadRtf(filePath);
}
Just to show it here, if you do this it will throw an error.
Can you please help me with this?