Hi,
i'm trying to create a highlight annotation using as a reference.
This is my code so far:
Code:
XRect xrect = new XRect(new XPoint(Double.Parse(annotation.Rect[0], CultureInfo.InvariantCulture), Double.Parse(annotation.Rect[1], CultureInfo.InvariantCulture)),
new XPoint(Double.Parse(annotation.Rect[2], CultureInfo.InvariantCulture), Double.Parse(annotation.Rect[3], CultureInfo.InvariantCulture)));
PdfHighlightAnnotation pdfAnnotation = new PdfHighlightAnnotation();
pdfAnnotation.Quadrilaterals = new List<PdfRectangle> { new PdfRectangle(xrect) };
pdfAnnotation.Title = annotation.Title;
pdfAnnotation.Color = XColor.FromArgb(annotation.Color[0], annotation.Color[1], annotation.Color[2]);
pdfAnnotation.Elements.SetString("/CreationDate", annotation.CreationDate);
pdfAnnotation.Rectangle = new PdfRectangle(xrect);
pdfDocument.Pages[pdfPage.PageNumber].Annotations.Add(pdfAnnotation);
The annotation gets created but it doesn't have any appearance.
As far as i understood i need to create an appearance stream, but i don't know how to do that.
Can anyone help me out?