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

Free Support Forum - aspose.com

java.lang.NoSuchMethodError: com.aspose.words.Paragraph.getAncestor()


we are currently testing the latest Aspose.Words for Java, to see if it is possible for us to implement a new reporting engine for our product.

Using the previous version, when doing mail merge of an image, we’d try to see if the image is in a table cell in order to resize it to fit.

The code looks like this:

Cell cell = (Cell) builder.getCurrentParagraph().getAncestor(NodeType.CELL);
if (cell != null) { ... }

However we get an exception saying java.lang.NoSuchMethodError: com.aspose.words.Paragraph.getAncestor(I)Lcom/aspose/words/Node

Did the getAncestor() method change?


Thanks for your inquiry. We have not made any change in subjected method. We will appreciate it if you please double check the issue at your end with latest version of Aspose.Words for Java. However if the issue persists then please share your sample code(without compilation error) along with your input document as ZIP file. We will look into the issue and will guide you accordingly.