Hi Team,
I’m using Aspose Diagram for java to identify hyperlinks in a vsd file.
I was using the below code, but it is giving me incorrect data. Can you pls help me with code to identify hyperlinks in vsd files.
Attaching a sample vsd file in zip.
ActvDir.zip (128.2 KB)
Code being used.
Diagram diag = new Diagram(dataDir+fileName1);
int pageCount=0,shapeCount=0,hyperlinkCount=0;
String linkName, linkURL;
pageCount = diag.getPages().getCount();
System.out.println("page count"+pageCount);
System.out.println("Page Name: "+diag.getPages().getPage(0).getName());
for(int i=0;i<pageCount;i++){
Page page = diag.getPages().getPage(i);
shapeCount=page.getShapes().getCount();
System.out.println("shape count" +shapeCount);
for(int j=1;j<=shapeCount;j++){
Shape shp = page.getShapes().getShape(j);
try{
hyperlinkCount = shp.getHyperlinks().getCount();
for(int k=0;k<hyperlinkCount;k++){
linkName=shp.getHyperlinks().get(k).getDescription().getValue();
linkURL=shp.getHyperlinks().get(k).getAddress().getValue();
if("".equals(linkName)){
linkName = linkURL;
}
System.out.println(linkName+ " - "+linkURL);
}
}catch(NullPointerException e){
System.out.println("No hyperlink found");
}
}
}
Thanks,
Vineet