Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Collapse]PDF Viewer
   [Expand]Getting Started
   [Expand]Interactive Forms
   [Expand]Navigation
   [Collapse]Interactivity
     File Attachment
     Text Markup Annotations
     Navigating and Viewing a Document
     Content Copying
     Document Rotation
     Zooming
     Printing
    Deployment
   [Expand]Examples
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Text Markup Annotations

When reviewing a document, you often need to draw attention to some important text the author can change later.

The PDF Viewer allows you to highlight, strikethrough, or underline text. You can also change the markup annotation properties (for example, add a comment to an annotation) or delete an annotation from a document.

The document includes the following sections:

Expanded Creating Text Markup Annotation

To highlight, strikethrough or underline text, use:

  • The corresponding text markup tool located in the viewer's Comment toolbar

    The text markup tools are available after opening a document in the PDF Viewer.

    To add a markup to text:

    • Click the corresponding tool button (for example, Highlight);
    • Select the text.

    The image below shows the text highlighted in the default color.

  • The viewer's context menu

    To add a markup to text:

    • Select the text;
    • Right-click the text and choose Highlight, Strikethrough or Underline item in the invoked context menu.

To highlight, strikethrough or underline selected text in code, call one of the PdfViewer.HighlightSelectedText, PdfViewer.StrikethroughSelectedText or PdfViewer.UnderlineSelectedText overload methods.

Changing default markup tool settings

You can customize the default markup tool settings that are applied to newly created markups.

To access the markup tool settings, use the PdfViewer.MarkupToolsSettings property.

You can change, for example, the default color used to underline a text using the PdfMarkupToolsSettings.TextUnderlineColor property.

To change the default markup color at runtime, click the drop-down arrow in the corresponding text markup tool and select the required color.

The default markup settings can also be modified using the Annotation Properties dialog. See the Editing Text Markup Annotation section to learn how to invoke this dialog.

When the markup annotation is being created in a document, it raises the PdfViewer.TextMarkupAnnotationCreating event. In this event, you can specify the markup annotation properties (for example, the annotation author using the PdfTextMarkupAnnotationCreatingEventArgs.Author property) and prohibit creating annotation.

Refer to the How to: Create a Text Markup Annotation and Specify its Properties example to learn more.

Expanded Editing Text Markup Annotation

You can change the markup annotation properties using the Annotation Properties dialog.

For example, to add a comment to a markup annotation:

  • Right-click the annotation and choose the Properties... item in the context menu;

    This invokes the Annotation Properties dialog.

  • Type a text in the dialog's Comment text box.

  • To save changes, click OK.

    The Annotation Properties dialog also allows you to change default settings for annotation color, opacity, subject, and author. The default settings are applied to newly created markups. To set new settings as the default, click Set as Default.

    If you want to cancel changes, click Cancel.

  • The comment is shown in the markup annotation's pop-up window.

The PDF Viewer also provides the PdfShowAnnotationPropertiesCommand command to invoke this annotation properties dialog in code.

Expanded Removing Text Markup Annotation

To remove an annotation:

  • Right-click the annotation;
  • Choose the Delete item in the invoked context menu.

  • or...

  • Select the annotation and press the Delete key.

You can also use the PdfDeleteAnnotationCommand command to delete the selected annotation programmatically.

When the markup annotation is being deleted, it raises the PdfViewer.AnnotationDeleting event. In this event, you can obtain the annotation name, annotation bounds on a page and the page number using the PdfAnnotationDeletingEventArgs.Name, PdfAnnotationDeletingEventArgs.Rectangle, and PdfAnnotationDeletingEventArgs.PageNumber properties. You can also prohibit deleting the annotation from a page.

How would you rate this topic?​​​​​​​