We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Strange Formatting issues when converting RTF to PDF

Having a bit of a strange issue when converting from RTF documents to pdf documents in what should be a super simple conversion.

So far, this is the first document i’ve come across that converts incorrectly and i cannot place my finger on why.

I’ve attached the RTF source and PDF output files and you should be able to see the problem . the right most 4 labels are not respecting the original format.

The code below is how i’m converting the rtf file to pdf.

lic.setLicense(new FileInputStream(licenseFile)); // valid license file

File outputFile = FileUtil.createTempFile(“converted”, “.pdf”);
Document doc;
doc = new Document(srcFile.getAbsolutePath());
return outputFile;

Has anyone experienced anything like this? i think there’s got to be something weird in the rtf, but this rtf renders fine in both MSWord and OpenOffice 3.3 and Wordpad so it can’t deviate that much from standard.

What have I missed?

EDIT: a couple extra things as I’m sitting here thinking about this.
This is effectively a mail merge document to be printed on Avery labels which are a sheet feed 3 label wide format.



Hi Jeff,

Thanks for reporting this problem to us. I have tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem as WORDSNET-7851 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Thank you for looking at this. I’m not sure how this file was created to cause this problem. If this is simply a matter of strange rtf, i’m happy to temporarily put a pre-processor in place to remove the strange formatting if at least to keep moving while we figure this out a more permanent fix.

FWIW: we use the Aspose.Words for Java.

I’m not sure if the solution will be different, but if there is a fix for this, can it be included in the Java packages?


Hi Jeff,

Thanks for your inquiry.

Please note that the latest version of Aspose.Words for Java is completely auto-ported from .NET, i.e. we do not write code for Aspose.Words for Java; it is generated out automatically from C# code of Aspose.Words for .NET. In your case, the issue, that was previously logged with WORDSNET prefix, would be auto resolved for Java variant of Aspose.Words as well. Your problem will be fixed as soon as the linked issue is resolved. Our development team is currently doing analysis of WORDSNET-7851 and rest assured we will inform you as soon as this issue is resolved. We apologize for any inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-7851) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.