Hi,
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);
builder.moveTo(dml);
dml.setName("http://Image" + ic);
dml.setHRef("http:/Image" + ic);
ic++;
}
}
doc.save(docPath + "ImageOutput.docx");
doc.save(docPath + "Output.pdf");