private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
pdfViewerControl1.TextSelectionBrushColor = System.Windows.Media.Color.FromRgb(0,255,0);
} |
//Add text markup annotation on the bounds of highlighting text
PdfTextMarkupAnnotation textmarkup = new PdfTextMarkupAnnotation(selectedtext.Value);
//Sets the markup annotation type as HighLight
textmarkup.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
//Sets the content of the annotation
textmarkup.Text = selectedText;
//Sets the highlighting color
textmarkup.TextMarkupColor = new PdfColor(System.Drawing.Color.OrangeRed);
//Add annotation into page
page.Annotations.Add(textmarkup); |