Hi,
I'm getting a NullReferenceException when using the pdfviewer.GetAnnotationComments() method.
On further investigation I've located the problem within the AnnotationRenderer class in the
internal ShapeAnnotation LoadPolylineAnnotation(PdfLoadedPolyLineAnnotation polylineAnnot, float pageHeight, float pageWidth, int pageRotation, PdfLoadedFreeTextAnnotation shapeFreeText)
method.
Code:
if (polylineAnnot.Dictionary.ContainsKey("BE"))
{
PdfDictionary pdfDictionary = polylineAnnot.Dictionary["BE"] as PdfDictionary;
if (pdfDictionary != null && (pdfDictionary["S"] as PdfName).Value == "C")
The if-statement throws a NullReferenceException since the pdfDictionary is NOT null, but has no entries.
How do I fix this?