-
Notifications
You must be signed in to change notification settings - Fork 136
Description
Exception in thread "main" java.lang.ClassCastException: com.aspose.pdf.LaunchAction cannot be cast to com.aspose.pdf.GoToURIAction
`Document document = new Document("C:\Users\admin.v.ramesh\Downloads\hyperlink to file.pdf");
Page page = document.getPages().get_Item(1);
AnnotationSelector selector = new AnnotationSelector(new LinkAnnotation(page, Rectangle.getTrivial()));
page.accept(selector);
List list = selector.getSelected();
// Iterate through individual item inside list
if (list.size() == 0)
System.out.println("No Hyperlinks found..");
else {
// Loop through all the bookmarks
for(LinkAnnotation annot : (Iterable<com.aspose.pdf.LinkAnnotation>)list)
{
//Annotation an = (Annotation)annot;
// Print the destination URL
System.out.println("URL: " + ((com.aspose.pdf.GoToURIAction)annot.getAction()).getURI());
}
}`