Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Dec 24, 2014 11:12 am

Hi,

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?

shrenik.gandhi
 
Posts: 10
Joined: Fri Sep 12, 2014 5:14 am

Thu Dec 25, 2014 1:21 am

Dear shrenik.gandhi,

Thanks for your inquiry.

To help us reproduce this issue, please attach your html document or the generated rtf document, if it is inconvenient to attach here, you could send them to my individual email(burning.liu@e-iceblue.com).
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Fri Dec 26, 2014 3:54 am

Hie,

Here is the attached HTML and the corresponding RTF file converted from the HTML file as mentioned above in the program.

shrenik.gandhi
 
Posts: 10
Joined: Fri Sep 12, 2014 5:14 am

Fri Dec 26, 2014 6:01 am

Dear shrenik.gandhi,

Thanks for sharing your code and sample documents.

I have reproduced this issue and posted it to our dev team, we will inform you if there is any update.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Mon Jan 05, 2015 8:05 am

Dear Shrenik,

Sorry to keep you waiting.

We just released a new version of Spire.Doc (Spire.Doc Pack(hot fix) Version:5.3.17) to resolve the problem: "Nullable object must have a value" when loading a RTF document, please download it via link below and have a try:
http://www.e-iceblue.com/Download/downl ... t-now.html
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Wed Jan 07, 2015 6:04 am

Hi,

There seems to be some other issue now.
I have attached the sample HTML file.
The code I am using is as mentioned below:

Code: Select all
var doc = new Document("sample.html",FileFormat.Html);
            doc.SaveToFile("sample.rtf", FileFormat.Rtf);
            doc.LoadRtf("sample.rtf");


Also when I save the file as RTF the whole HTML is not converted to RTF and saved, I get only half the file.
Attaching the converted RTF file too.

shrenik.gandhi
 
Posts: 10
Joined: Fri Sep 12, 2014 5:14 am

Wed Jan 07, 2015 7:22 am

Dear Shrenik,

Thanks for your inquiry.

I have reproduced this problem and posted it to our dev team, we will inform you if there is any update.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Wed Jan 28, 2015 8:16 am

Dear Shrenik,

Sorry to keep you waiting.

We just released a new version of Spire.Doc (Spire.Doc v5.3.38) to fix this problem, please download it via link below and have a try:
http://www.e-iceblue.com/Download/downl ... t-now.html
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Return to Spire.Doc

cron