objective c - Getting the bounding box of each glyph in pdf - iOS -
i've been trying highlight text in pdf. after lot of research , experiments, seems have find bounding box of each glyphs, create overlay actual drawing happening, , highlight text filling cgrect info bounding box , fill color. now, stumped bounding box.
i've been using pdfkitten
search , highlight text. want use select , highlight text. don't understand how use bounding box ( other information ascent, descent, capheight, etc.) fill highlight searched word. when tried access fontdescriptor
class info, displays this:
2012-06-28 16:32:20.626 er[2408:15203] x:-665, y:-325, width:2000, height:1006 2012-06-28 16:32:20.627 er[2408:15203] x:-157, y:-250, width:1126, height:952 2012-06-28 16:32:20.628 er[2408:15203] x:-628, y:-376, width:2000, height:1010
it confusing if can clarify this, appreciated.
you cannot use font descriptor information bounding box glyph.
pdfkitten takes care of finding width , height of each glyph using renderingstate model.
you can use same find location of word while scanning pdf.
font dictionary provides widths glyph. can use cid correct width of glyph.
try highlighting code of pdfkitten.
Comments
Post a Comment