How do I get text under text markup annotation?

140 views
Skip to first unread message

Support

unread,
Jun 20, 2014, 12:33:55 AM6/20/14
to pdfnet-w...@googlegroups.com
Q:

I have a highlight annotation and would like to obtain text under highlight?
So how do I get annotated text?

------------
A:

To obtain selected text you could use myWebViewer.getInstance().docViewer.GetSelectedText().

 

Finding text under highlight annotation is not a one line of code but it can be done. For example, use annotation rectangle to find what text intersects with the region (for text annotation you can obtain precise positioning info using the Quads property).


The following post gives a concrete solution using another approach (use annot rect to make selection then fetch the selected text): https://groups.google.com/forum/#!msg/pdfnet-webviewer/kOl1bkil8fQ/AsZjtVQhWhEJ

Volker Andres

unread,
Apr 10, 2017, 11:30:45 AM4/10/17
to PDFTron WebViewer
Could you please post the annotation rectangle example?

Justin Jung

unread,
Apr 10, 2017, 7:02:07 PM4/10/17
to PDFTron WebViewer on behalf of Volker Andres
Hello,

You can refer to a newer post regarding extracting text under a rectangle: https://groups.google.com/d/msg/pdfnet-webviewer/h2W3VksbQUI/oGFwbyNeDAAJ

Justin Jung
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages