Hello sir
I’m trying to extract highlighted text.
You can see Yellow highlighted text in my pdf.
HIGHLIGHT TEST.pdf (3.4 KB)
I want to get text “TEST1” and “TEST2” but
getMaredText and GetMarkedTextFragments doesn’t work.
Let me know how to solve this problem and have a nice day~
-
here is my code
foreach (var p in pages)
{
foreach (Annotation ann in p.Annotations)
{
if(ann.AnnotationType == AnnotationType.Highlight)
{
HighlightAnnotation highlightAnnotation = ann as HighlightAnnotation;string b = highlightAnnotation.GetMarkedText(); TextFragmentCollection collection = highlightAnnotation.GetMarkedTextFragments(); string text = string.Empty; foreach(TextFragment tf in collection) { text += tf.Text; } string a = "a"; } }
}