PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Dec 04, 2021 4:30 am

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Feb 26, 2020 10:25 am 

Joined: Wed Feb 26, 2020 9:41 am
Posts: 1

i'm trying to create a highlight annotation using as a reference.

This is my code so far:
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);


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?

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 64 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group