How to get custom stamp annotation using coordinate X and Y?

75 views
Skip to first unread message

Chirag Patel

unread,
Jan 9, 2015, 6:28:51 AM1/9/15
to pdfne...@googlegroups.com
We have licence of PDFtron. I am trying to remove custom stamp annotation using on click on mouse. on Mouse Click i get x and y coordinate. How can i removed the click custom stamp annotation.

Ryan

unread,
Jan 9, 2015, 2:58:38 PM1/9/15
to pdfne...@googlegroups.com
If you are using a PDFViewCtrl class, there should be a method called GetAnnotationAt or similar (exact method depends on platform).

So something like the following...
PDFDoc doc = m_viewer.GetDoc();
doc
.Lock(); // write lock
Annot annot = m_viewer.GetAnnotAt(x,y);
Page page(m_viewer.GetPageNumberAt(x, y);
page
.AnnotRemove(annot);
doc
.Unlock();
m_viewer
.Update(); // there might be a version of Update available that takes an annot, therefore avoiding refreshing everything...


Reply all
Reply to author
Forward
0 new messages