You are viewing limited content. For full access, please sign in.

Question

Question

I am trying to add a Highlight Annotation how do I do this in code? c#

SDK
asked on October 3, 2014

I have successfully coded textboxes, arrows (lines), and sticky notes but I cant figure out hoe to add a high light. I followed the same patter with the other three but highlights elude me. What goes in the type casting parenthesis ? Please advise.

Here is a snip of my code:

 

 var docPages = (LFDocumentPages)_document.Pages;
 var firstPage = (LFPage)docPages.Item[1];

var highlight = (WHAT GOES HERE?) firstPage.AddAnnotation(Annotation_Type.ANN_HIGHLIGHT);

0 0

Answer

SELECTED ANSWER
replied on October 4, 2014 Show version history

Highlights, redactions, strikeouts and underlines are all of type LFLinkedAnnotation, here is an example:

LFLinkedAnnotation highlightAnn = (LFLinkedAnnotation)page.AddAnnotation(Annotation_Type.ANN_HIGHLIGHT);
LFRectangle highlightRect = highlightAnn.AddRectangle();
highlightRect.Left = 100;
highlightRect.Top = 100;
highlightRect.Right = 200;
highlightRect.Bottom = 200;
highlightAnn.Color = 0xFF0000;
page.Update();

 

1 0

Replies

replied on October 4, 2014

@Robert Strickland Thank you very much that helped.

0 0
replied on October 6, 2014

Hello Theodore,

 

If your question has been answered, please remember to select the "This answered my question" button below the appropriate post!

 

Thanks!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.