1

I want to extract the text inside a bounding box specified inside highlight annotation using the PSPDFKit. Can anybody say how to do this?

1 Answers1

0

To get the text that's beneath a PDF highlight annotation, you need to iterate over all rects and contact the affected glyphs. (You can ignore the boundingBox for that) The highlight annotation just has rect data, not text, so it's a bit tricky to get right.

There's also a convenience method on PSPDFHighlightAnnotation called highlightedString, which will do all this work for you.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
steipete
  • 7,581
  • 5
  • 47
  • 81