Как создать поток оформления для аннотаций с использованием pdfsharp? - PullRequest
0 голосов
/ 26 февраля 2020

Я пытаюсь создать аннотацию выделения, используя этот пост в качестве ссылки.

Это мой код:

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);

Аннотация создается, но не имеет внешнего вида. Насколько я понял, мне нужно создать поток внешнего вида, но я не знаю, как это сделать.

Кто-нибудь может мне помочь?

...