When extracting LinkAnnotation from an existing PDF document i get "Object reference not set to an instance of an object" .
I am attempting to follow the example here: http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/extract-links-from-the-pdf-file.html
Here is my code (I have attached the pdf file that i am using)
Dim pdfDocument As New Aspose.Pdf.Document("M:\temp\TestProgrammingFiles\InputC.pdf")<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Dim page As Page = pdfDocument.Pages(1)<o:p></o:p>
Dim selector As New AnnotationSelector(New LinkAnnotation(page,
Aspose.Pdf.Rectangle.Trivial))<o:p></o:p>
MsgBox(selector.Selected.Count.ToString) 'This Retruns 0<o:p></o:p>
page.Accept(selector) 'Throws
an error - “Object reference not set to an instance of an object.”<o:p></o:p>
Dim list As IList = selector.Selected<o:p></o:p>
Dim annotation As Annotation = CType(list(0),
Annotation)<o:p></o:p>
I am using VB.Net, Aspose.pdf 6.1, Visual Studio 2010.
Thanks