Hiding text/comment annotation bubbles using PDFViewWPF?

25 views
Skip to first unread message

Ryan

unread,
Aug 17, 2018, 7:24:41 PM8/17/18
to PDFTron PDFNet SDK
Question:
We want to provide a toggle to turn annotation rendering on off, with the PDFViewWPF.SetDrawAnnotations function. We call it and it works fine, but if there happen to be comment popup bubbles for one or more annotations open, then they remain on screen, though the annotation they point to is not visible.

How do we close, or minimize, these dialogs?

Answer:
The drawing of the text/comment bubbles is entirely in the PDFViewWPFTools project, so you need to make the following changes, and then make the call yourself to trigger.

1. Add the following method to NoteManager.cs
internal void CloseNotes()
{
 
var tempDict = new Dictionary<Markup, NoteHost>(mActiveNotes);
 
foreach (KeyValuePair<Markup, NoteHost> entry in tempDict)
 
{
   
CloseNote(entry.Key);
 
}
}

2. In ToolManager.cs add the following method
public void CloseNotes()
{
 
NoteManager.CloseNotes();
}

Then in your code, call ToolManager.CloseNotes();
Reply all
Reply to author
Forward
0 new messages