How do I get ounding boxes (or quads) for each glyph?

38 views
Skip to first unread message

Support

unread,
Jan 14, 2015, 4:40:21 PM1/14/15
to pdfne...@googlegroups.com

Q:

How can we iterate through all glyphs on a page (including extrapolated spaces) and retrieve bounding boxes (or quads) for each glyph as well as the text associated with that glyph respectively?”

------

A:

You would use pdftron.PDF.TextExtractor as shown in TextExtract sample:

    https://www.pdftron.com/pdfnet/samplecode.html#TextExtract

   https://www.pdftron.com/pdfnet/samplecode/TextExtractTest.java.html

 

You can get a bbox for every line, word, or a character:

https://www.pdftron.com/pdfnet/mobile/docs/Android/pdftron/PDF/TextExtractor.html

https://www.pdftron.com/pdfnet/mobile/docs/Android/pdftron/PDF/TextExtractor.Line.html#getBBox()

https://www.pdftron.com/pdfnet/mobile/docs/Android/pdftron/PDF/TextExtractor.Word.html#getQuad()

https://www.pdftron.com/pdfnet/mobile/docs/Android/pdftron/PDF/TextExtractor.Word.html#getGlyphQuad(int)

 

In case you are referring to WebViewer (https://www.pdftron.com/webviewer), we offer the same functionality there, but the API is a bit different.


Reply all
Reply to author
Forward
0 new messages