We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Getting Text and Location of annotations of a page

Thread ID:





118923 Apr 23,2015 03:38 PM UTC Apr 27,2015 01:20 PM UTC WinRT 4
Tags: PDF
Ric Silva
Asked On April 23, 2015 03:38 PM UTC

i have this code to add annotations to a pdf page

                    var page = pdfDocument.Pages[pagn];
                    string pdfAnnotationMsg = "Test Annotation 123";
                    PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(new RectangleF((float)x, (pageHeight * 1.325f) - (float)y - VertOff2, 5, 5), pdfAnnotationMsg);
                    popupAnnotation.Border.Width = 1;
                    popupAnnotation.Open = false;
                    popupAnnotation.Border.HorizontalRadius = 1;
                    popupAnnotation.Border.VerticalRadius = 1;
                    popupAnnotation.Icon = PdfPopupIcon.Comment;

the annotation gets added correctly but now im trying to access to its content and location 
i have this variable :

PdfLoadedAnnotationCollection annotationCollection = pdfDocument.Pages[0].Annotations;

and its count number shows the correct ammount of annotations, but if i use
i get a exception:

"A first chance exception of type 'System.NullReferenceException' occurred in Syncfusion.Pdf.WinRT.DLL"

how do i properly get the Text and Location from the diferent Annotations ? 

Ric Silva
Replied On April 23, 2015 03:47 PM UTC

forgot to mention im using version 

Abirami Selvan [Syncfusion]
Replied On April 24, 2015 12:25 PM UTC

Hi Ric ,

Thank you for using syncfusion product .

We are unable to reproduce the issue “Getting null reference exception when load the annotation text” .We have attached the sample which we have tried to reproduce the exception in below link :



Please modify the sample or provide us the input document which you have tried to  reproduce this issue . It will help us to proceed further in this issue .

And we are able to reproduce the issue “Getting empty bounds when load the annotation location” . We will update the complete details regarding this issue on 28th April ,2015.


Thanks ,


Ric Silva
Replied On April 24, 2015 02:35 PM UTC

ok i solved the problem some how eheh

i was loading the file to the viewer this way 

pdfViewer.DocumentLoaded += (sender, e) =>
                        pdfViewer.ViewMode = PageViewMode.FitWidth;

                    catch (Exception e1)

i replaced it with:

pdfViewer.ViewMode = PageViewMode.FitWidth;

and for some reason my annotation code started working

Abirami Selvan [Syncfusion]
Replied On April 27, 2015 01:20 PM UTC

Hi Ric,

We are happy to know that the issue fixed in your side.

Please let us know if you need further assistance.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon