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);
Steps to be followed:
- Drag the text box control, which is available at the left, to the displayed document at the required position.
- Using the text box, you can enter and edit the text, and also move and delete the text box control.
- 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.
- To open a new document, go to File, and click Save.