Aspose API Conversion from RTF to PDF in DOTNET and JAVA

Hi Team,
I’m currently using ASPOSE API(Aspose.Words) for converting the RTF document to PDF in DotNet and Java .

In Java , if i send the wrong/invalid RTF Document, then from ASPOSE API I’m getting an error i.e.The document appears to be corrupted and cannot be loaded.

In DotNet, If i send the same wrong/Invalid RTF Document, ASPOSE API is not returning any error message, Ideally I’m expecting an error message from ASPOSE API as shown below.

// T:Aspose.Words.FileCorruptedException:
// The document appears to be corrupted and cannot be loaded.

Any information will be much helpful.

@Suchai_tammewar,

Thanks for your inquiry. Please ZIP and attach your input RTF here for testing. We will investigate the issue on our side and provide you more information.

Thanks manzoor for responding !!!, Please find the attached RTF Document.RTF2.zip (14.5 KB)

@Suchai_tammewar,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 17.10 and have not found the shared issue. Please use the try catch block and check the exception message. It is “The document appears to be corrupted and cannot be loaded”.

okay Thanks Manzoor ! we have tested this is .NET 17.9 and also used the trail version.

@tahir.manzoor,
Can you please try the same RTF in 17.9 version and can you please confirm us whether the issue is present.

@Suchai_tammewar,

Thanks for your inquiry. We have tested the scenario using Aspose.Words 17.9 and have faced the same exception.

@tahir.manzoor: Thanks for providing the Info,
So with the Version 17.9 we are not receiving any error, but it is getting converted to PDF but the PDF is showing the errors in the data. like Error ! References source not found.Error!Reference source not found.

I’m attaching the Screenshot of it.
ErrorPDF.JPG (15.0 KB)

with the Version 17.10, we are able to convert to PDF with issues similar to that of 17.9 version dll , i dont see any difference.

The problem here is I’m using the 16.10 jar for Java and it was throwing the error for converting to PDF( Which is expected) i.e. The document appears to be corrupted and cannot be loaded.

But the same is not with .Net 17.10, it is converted to PDF with issues, ideally it should not Convert, we should receive an error.

@Suchai_tammewar,

Thanks for your inquiry. We faced the exception “The document appears to be corrupted and cannot be loaded” while using Aspose.Words v17.9, 17.10, and 17.11. We have attached the RTF document with this post that we used to test the scenario.
rtf.zip (8.4 KB)

If you are using different RTF document, please ZIP and attach it here for testing. We will investigate the issue and provide you more information on this. Could you please also share the Java version that you are using?

@tahir.manzoor: Thanks Manzoor, For me in JAVA it is throwing an exception with the same RTF which i sent earlier by using 16.10 version.

But, I want to be tested with the .Net version, So im expecting the same error in .NET using 17.10, but .Net is not returning any error from the RTF which i attached earlier.

but you are saying that with Version 17.10 in .NET, it is throwing an error, which is not happening to me. So request you to please share the logic which you are testing. I’m using Memory stream to store the RTF , are you using in the same way ?

Also, Will there be any difference between the Trial version and the License version ?

Thanks,
Suchai

@Suchai_tammewar,

Thanks for your inquiry. We used following code example to test the scenario.

Aspose.Words.License lic = new Aspose.Words.License();
lic.SetLicense(@"Aspose.Total.lic");    
MemoryStream stream = new MemoryStream(File.ReadAllBytes(MyDir + "in.rtf"));
Document doc = new Document(stream);

Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. We will investigate the issue on our side and provide you more information.

@tahir.manzoor,
Thanks Manzoor, So did you tried the scenario with the Trail Version or with License version of 17.10 dll in .Net ? Can you please confirm this .

Also will there be any difference in the Trail version versus License version ? Please let me know.

@Suchai_tammewar,

Thanks for your inquiry. We tested the scenario with and without license and have faced the same exception.

Please note that in evaluation mode there are some limitations applied. E.g. Aspose.Words injects an evaluation watermark at the top of the document. The document’s contents are truncated after a certain number of paragraphs during import or export.

Please request for 30-days temporary license from here:
Get temporary license

@tahir.manzoor: Thanks Manzoor, i was able to replicate this issue now by using .NET 17.10 dll. Thanks for your support.