Hello,
I have an RTF document that is throwing an Exception when we try to convert to PDF. After doing some research, I can get the Exception to happen simply by trying to get a page count:
@Test
public void testDocument() throws Exception {
String rtfName = "/some/path/bad-page.rtf";
String pdfName = "/some/path/bad-page.pdf";
Document document = new Document(rtfName);
System.out.println("section count: " + document.getSections().getCount());
System.out.println("variable count: " + document.getVariables().getCount());
System.out.println("page count: " + document.getPageCount());
document.save(pdfName, SaveFormat.PDF);
System.out.println("done!");
}
It will throw an Exception on the 6th line of the method. If you remove that line you get the same Exception when trying to do a save to PDF.
I am uploading a zipped sample RTF document.
What can I do to the RTF document to allow Aspose.Words to convert this RTF to PDF without errors?
Thanks,
Ken Kennedy
bad-page.rtf.zip (10.2 KB)