Im new to PDFNet, im trying the trial version...
Im displaying a PDF on the PDFViewWPF and it renders ok.
Now i wanted to create a sticky annotation on it and open the pop up with the annotation text when i click on it.
Right now i can create the annotation and i can see the icon of it but i dont know how to do to open the pop up when i click on it?
Example code:
// Create a Sticky Note
pdftron.PDF.Annots.Text txt = pdftron.PDF.Annots.Text.Create(doc, new pdftron.PDF.Rect(130, 388, 180, 406), "Hello World");
// Create a 'pop-up' annotation associated with the sticky note.
pdftron.PDF.Annots.Popup pop = pdftron.PDF.Annots.Popup.Create(doc, new pdftron.PDF.Rect(272, 300, 450, 450));
pop.SetParent(txt);
txt.SetPopup(pop);
txt.RefreshAppearance();
var first_page = doc.GetPage(1);
// Add annotations to the page.
first_page.AnnotPushBack(txt);
PdfViewWpf.Update(txt, 1);
I should be able to get the annotation when i click on it and then open the pop up right?
I can atach to the MouseLeftButtonUp event on the PdfViewWpf but then i dont know how to continue:
void Current_View_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
var mouseClick = e.GetPosition(Current_View);
var annot = Current_View.GetAnnotationAt(mouseClick.X, mouseClick.Y);
if (annot != null)
{
var annotationSelected = new Annot(annot);
//TODO Continue
}
}
Any help will be helpfull, thanks.