pdf2json
pdf2json copied to clipboard
bounding boxes
Could the documentation explain how to calculate bounding boxes for text items?
Text has x, y and w but no h. I presume that the font size could give you h, but they seem to be in other units. How should I convert?
BTW, what is the "TS" element? Can this help me?
TS is 'Text Style', line 332 in pdffont.js: let TS = [this.faceIdx, this.fontSize, this.bold?1:0, this.italic?1:0].
Since embedded font is not supported in parser, bounding box is determined by rendering platform. For example, in browser rendering, it's Element.getBoundingClientRect()
Is it possible to get the bounding rectangle without rendering the document? I am using the module to scan a PDF and extract text at specific locations which I would like to derive from they're bounding rectangle.