Articles in this section
Category / Section

How to include popup annotation in PDF document using WPF PDFViewer?

1 min read

Currently, WPF PDFViewer control does not have support for including the pop-up annotation. However, the following workaround has the support for the same action in WPF.

C#

 //Create a new popup annotation
 PdfPopupAnnotation popupAnnotation = new PdfPopupAnnotation(bounds, textBox.Text);
 
 // Set the location
 popupAnnotation.Location =new System.Drawing.PointF(Point.X, Point.Y);
 
 // Set the properties
 popupAnnotation.Border.Width = 4;
 
 //Set the pdf popup icon
 popupAnnotation.Icon = PdfPopupIcon.Note;
 
 //Add this annotation to a new page
 ldoc.Pages[currentPageIndex].Annotations.Add(popupAnnotation);

View sample in GitHub.

Steps to be followed: 

  1. Drag the text box control, which is available at the left, to the displayed document at the required position. 
  2. Using the text box, you can enter and edit the text, and also move and delete the text box control. 
  3. To save the pop-up annotations in the document, go to File, and click Save. It will save the text as PopupAnnotation in the resultant file. 
  4. To open a new document, go to File, and click Save. 
Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied