pdf2json icon indicating copy to clipboard operation
pdf2json copied to clipboard

Getting absolute coordinates for text

Open abhijitborade opened this issue 9 years ago • 4 comments

Is there any way I can get absolute coordinate of the text. Currently pdf2json is giving me relative coordinates. I want to place an image at the coordinates I get.

abhijitborade avatar Dec 07 '16 13:12 abhijitborade

Relative to what? As far as I know its relative to the anchor position, so just add that on?

SPlatten avatar Jun 21 '17 09:06 SPlatten

@SPlatten I am getting coordinates for an element relative to its container or something. I don't know. I wanted absolute coordinates. I mean from the corner i.e. 0,0 of the page.

abhijitborade avatar Jun 24 '17 08:06 abhijitborade

@abhijitborade @SPlatten Did you guys manage to get coordinates relative to the page? I'd like to modify something around a specific string but the coordinates I'm getting are very different, perhaps relative to the square container 🤷‍♂️

Edit: Nevermind, this other package outputs coordinates relative to the page: https://github.com/ffalt/pdf.js-extract

frandiox avatar Dec 01 '18 08:12 frandiox

Sorry it’s been a long time since I worked on this I don’t think I made progress.

Sent from my iPhone

On 1 Dec 2018, at 08:34, Fran Dios [email protected] wrote:

@abhijitborade @SPlatten Did you guys manage to get coordinates relative to the page? I'd like to modify something around a specific string but the coordinates I'm getting are very different, perhaps relative to the square container 🤷‍♂️

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

SPlatten avatar Dec 01 '18 13:12 SPlatten