AHK PDF get position of a string

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Brazolek123
Posts: 187
Joined: 06 Jun 2016, 16:02

AHK PDF get position of a string

Post by Brazolek123 » 16 May 2021, 10:55

I use xpdf to extract text/images from pdf file. So I have main pdf file (a scientific article, white paper) and have output files from xpdf: file_content.txt and six .png files for each of six page of the article.

What I'd like to achieve is to:
1) find string of interest in the file_content.txt file
2) locate position (x,y) in pixels of the mentioned string in the output *.png files
3) crop the rectangle from it, lets say of 200x50px and then do some other things with it

So while part 1) and 3) are relatively easy to do, I'm struggling with 2). Basically I have no idea how to perform it. I'm open for suggestions. Thanks for the help in advance!
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: AHK PDF get position of a string

Post by rommmcek » 17 May 2021, 11:33

If the font and the size of the text are predictable, then you could try with FindText.
Post Reply

Return to “Ask for Help (v1)”