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

Free Support Forum - aspose.com

Issue rendering image hyperlinks in PDF

We have been facing an issue rendering image hyperlinks when a word document is converted to a PDF file in a specific scenario. When we have multiple images lined up in a word document and we insert hyperlinks on those drawing ML nodes (programatically, or manually in Word) and we make a call to the save API, then the rendered pdf is found to have the second image’s hyperlink below the image boundary. Could you explain how or why this is happening, or if there is any option that we might need to set when saving to pdf? Attaching the input and output documents, as generated by the code below. Thanks.

Document doc = new Document(docPath + "ImageInput.docx");
SectionCollection sc = doc.getSections();
Iterator scItr = sc.iterator();
Section next = null;
while (scItr.hasNext())
    next = scItr.next();
    NodeCollection dmlShapes =
    next.getChildNodes(NodeType.DRAWING_ML, true);
    int ic = 0;//image count
    for (DrawingML dml : (Iterable)dmlShapes)
        NodeCollection childNodes = parentParagraph.getChildNodes();
        dmlIndex = childNodes.indexOf(dml);
        dml.setName("http://Image" + ic);
        dml.setHRef("http:/Image" + ic);

doc.save(docPath + "ImageOutput.docx");
doc.save(docPath + "Output.pdf");

Hi Praneeth,

Thanks for your inquiry. After an initial test with Aspose.Words for Java 14.6.0, I was unable to reproduce this issue on my side (please see attached out.pdf). I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link. I hope, this helps.


Best regards,

Thanks for the quick reply. I suppose that it is an issue with the version of Aspose that we’re using, since I’ve tried it out with your latest jar file and it does solve the problem.

Hi Praneeth,

Thanks for your feedback. It is great that the latest version of Aspose.Words resolves your problem. Please let us know any time you have any further queries.

Best regards,