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

Free Support Forum - aspose.com

Missing Link Annotation Action

I have run into instances where the link annotation action is missing. Attached is an example document

Hi Brent,


Thanks for contacting support.

From your above statement, do you mean that you are unable to get information related to Actions associated with links present over first page of document ? For the sake of testing, I have used the following code snippet to get the information related to links present in PDF file and as per my observations, nothing is being returned (however the links are properly directing to respective pages). Please acknowledge, so that we can further look into this matter. We are sorry for your inconvenience.

[C#]

//
load source PDF file containing hyperlinks
<o:p></o:p>

Document document = new Document("c:/pdftest/reference-standards.pdf");

// traverse through all the page of PDF

foreach (Aspose.Pdf.Page page in document.Pages)

{

// get the link annotations from particular page

AnnotationSelector selector = new AnnotationSelector(new Aspose.Pdf.InteractiveFeatures.Annotations.LinkAnnotation(page, Aspose.Pdf.Rectangle.Trivial));

page.Accept(selector);

// create list holding all the links

IList list = selector.Selected;

// iterate through invidiaul item inside list

foreach (LinkAnnotation a in list)

{

Console.WriteLine("Action : " + (a.Action as Aspose.Pdf.InteractiveFeatures.GoToRemoteAction));

}

}

Yes, I went about it a little different but. basically the a.action is null/nothing when it should be a gotoaction.


Brent

Hi Brent,


Thanks for the acknowledgement.

I have logged it in our issue tracking system as PDFNEWNET-37038. We will
investigate this issue in details and will keep you updated on the status of a
correction. <o:p></o:p>

We apologize for your inconvenience

The issues you have found earlier (filed as PDFNEWNET-37038) have been fixed in Aspose.Pdf for .NET 9.5.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Brent,


Thanks for your patience. We have investigated the issue and fount that your document does not contain actions in the annotations. Annotations contain destinations (XYXExplicitDestination), thus action.Destination property should be used instead of Action. Please check sample code snippet as following.

// load source PDF file containing
hyperlinks
<o:p></o:p>

Document document = new Document("c:/pdftest/reference-standards.pdf");

// traverse through all the page of PDF

foreach (Aspose.Pdf.Page page in document.Pages)

{

// get the link annotations from particular page

AnnotationSelector selector = new AnnotationSelector(new Aspose.Pdf.InteractiveFeatures.Annotations.LinkAnnotation(page, Aspose.Pdf.Rectangle.Trivial));

page.Accept(selector);

// create list holding all the links

IList list = selector.Selected;

// iterate through invidiaul item inside list

foreach (LinkAnnotation a in list)

{

//Actions does not contain actions; a.Action is null.

//Console.WriteLine("Action : " + (a.Action as Aspose.Pdf.InteractiveFeatures.GoToRemoteAction));

XYZExplicitDestination xyz = a.Destination as XYZExplicitDestination;

Console.WriteLine("Page : " + xyz.PageNumber + " X = " + xyz.Left + " Y = " + xyz.Top + " Zoom = " + xyz.Zoom);

}

}


Please feel free to contact us for any further assistance.


Best Regards,