TextInRectangle functionality

285 views
Skip to first unread message

marius

unread,
Jan 22, 2016, 3:07:32 AM1/22/16
to pdfium
Hello!

I'm trying to implement a TextInRectangle functionality (moving the mouse on a page, left click on, and on mouse up select the text in the generated rectangle).
For this I am using at this moment GetBoundedText available from PDFium but the results are not what one would expect. Sometimes it actually does not give any result at all, but the rectangle contains page text. 
Has anyone tried to use this methods, or is there any best practice when it comes to text selection via PDFium?

Marius.

Lei Zhang

unread,
Jan 28, 2016, 3:58:54 AM1/28/16
to marius, pdfium
Can other PDF viewers highlight the text in question? Can you check
with FPDFText_GetCharIndexAtPos() and see if it finds any text there?
How about if you loop through all the characters with
FPDFText_CountChars() and FPDFText_GetUnicode() ?
> --
> You received this message because you are subscribed to the Google Groups
> "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pdfium+un...@googlegroups.com.
> To post to this group, send email to pdf...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pdfium/2c22a503-67d2-4c88-ab5e-582b0d03ceea%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages