Error with RTF to PDF Conversion

Technical support for Spire.Doc

Moderator: iceblue support

Error with RTF to PDF Conversion

Postby jeremyodom » Thu Jul 11, 2013 4:52 pm

I have a .NET application that converts dozens of RTF files to PDF on a nightly basis. Occasionally, maybe once a week, I get the following error message with a few of the files:

Value cannot be null.
Parameter name: entity


What I've found with all of the files that have this error is that the RTF file has an embedded image of some sort. These are patient medical files so I'm unable to provide you with a copy, unfortunately. If I manually convert the RTF files to PDF using Adobe Acrobat Standard, I have no problem. Please advise on how to resolve this issue.
jeremyodom
 
Posts: 3
Joined: Wed Jan 23, 2013 6:18 pm

Re: Error with RTF to PDF Conversion

Postby Gary.zhang » Fri Jul 12, 2013 6:58 am

Hello,

Thanks for your inquiry.

We don't reproduce the error with the RTF file has an embedded image and Spire.Doc4.9.6.
Please provide us a sample RTF file which doesn't include the patient medical information so that we can reproduce the error and work out the solution for you ASAP.

Thanks,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am

Re: Error with RTF to PDF Conversion

Postby jeremyodom » Fri Jul 12, 2013 7:07 pm

How would you like me to get the RTF file to you since your forum doesn't allow RTF attachments?
jeremyodom
 
Posts: 3
Joined: Wed Jan 23, 2013 6:18 pm

Re: Error with RTF to PDF Conversion

Postby Gary.zhang » Mon Jul 15, 2013 6:34 am

Hello,

Sorry for the delay reply as weekend.

Thanks for the information you provided. We have used Spire.doc4.9.6 to test your RTF file with the below code in our windows 2008 R2 server with visual studio 2008 environment, but didn't reproduce the error you encountered. Please provide us the complete code.

Document doc = new Document();
doc.LoadFromFile(@"..\..\CL0010_20130711_033776_91791_160322.rtf");
doc.SaveToFile(@"..\..\CL0010_20130711_033776_91791_160322.pdf",FileFormat.PDF);

Thanks,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am

Re: Error with RTF to PDF Conversion

Postby jeremyodom » Mon Jul 15, 2013 5:08 pm

Here is my snippet. I"m using the loadrtf function to specifically get an RTF file:

Code: Select all
   
          Dim doc As New Document       
           'Convert RTF to PDF
            Try
                doc.LoadRtf(rtfFilePath)
                doc.SaveToFile(pdfFilePath, FileFormat.PDF)
            Catch ex As Exception
                'Set the error flag to true and append the filename and error message to a string builder
                ConvertErr = True
                sbBadFiles.AppendLine(Rdr("DocName") + Space(3) + ex.Message)

                'Create the Bad Files directory if it doesn't exist
                If Not Directory.Exists(_LocalPath + "BadFiles") Then
                    Directory.CreateDirectory(_LocalPath + "BadFiles")
                End If

                'Copy the RTF to the Bad Files directory
                File.Copy(rtfFilePath, _LocalPath + "BadFiles\" + Rdr("DocName"), True)
            End Try

            'delete the original RTF file
            File.Delete(rtfFilePath)

            'Increment the file count
            iCnt += 1
jeremyodom
 
Posts: 3
Joined: Wed Jan 23, 2013 6:18 pm

Re: Error with RTF to PDF Conversion

Postby Gary.zhang » Tue Jul 16, 2013 3:26 am

Hello Jeremy,

Thanks for your information.

I tested your code with Spire.Doc4.9.6, but the issue is still not been reproduced in our side. I attached a full Demo. Please try to run it in your side , then tell us whether it works fine or not . There are the dll files referenced as below,
1.Spire.doc.dll v4.9.6.3040
2.Spire.license.dll v1.3.2.40
3.Spire.pdf.dll v2.8.30.3040

If there are any questions, welcome to get it back to us.

Sincerely,
Gary
E-iceblue support team
You do not have the required permissions to view the files attached to this post.
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am

Re: Error with RTF to PDF Conversion

Postby Gary.zhang » Fri Jul 19, 2013 9:41 am

Hello Jeremy,

Have you tested the Demo in previous email? Does it work fine on your side? Has the issue been resolved? Could you please give us some feedback if convenience?

Thanks,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am

Re: Error with RTF to PDF Conversion

Postby Gary.zhang » Thu Aug 01, 2013 7:35 am

Hello Jeremy,
The issue has been resolved, the new version of Spire.Doc has been released, please download and test Spire.Doc Pack (Hot Fix) Version:4.9.13 from the following link,
http://www.e-iceblue.com/Download/download-word-for-net-now.html

If there are any questions, welcome to get it back to us.

Sincerely,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests