Skip to main content
williamj58744152
Participant
Feb 4, 2019 4:13 PM UTC
Answered

JPG pixel coordinates to PDF coordinates converter?

Hello,

Does anyone have a tool or know of the pixel conversions for a JPG image point to PDF document location?

Regards,

William Johnston

This topic is closed to new replies. Start a new post to keep the conversation going.
Thom Parker
Thom ParkerCorrect answer
Community Expert
Feb 4, 2019 5:27 PM UTC

Images are images, regardless of the file format they are all an array of pixels. The PDF  coordinate spaces are all measured at 72points/inch.  So if you know the image location, width, and height in PDF coordinates, then it's a straight forward conversion to find the location of a pixel.

For example, to get the horizontal coordinate:

xPDF = xImageCoord + xPixel * ImageWidthPDF/ImageWidthPixels

Of course, how this is done depends on the context. What are you trying to do?

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often

2 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
Feb 4, 2019 5:27 PM UTC

Images are images, regardless of the file format they are all an array of pixels. The PDF  coordinate spaces are all measured at 72points/inch.  So if you know the image location, width, and height in PDF coordinates, then it's a straight forward conversion to find the location of a pixel.

For example, to get the horizontal coordinate:

xPDF = xImageCoord + xPixel * ImageWidthPDF/ImageWidthPixels

Of course, how this is done depends on the context. What are you trying to do?

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
williamj58744152
Participant
Feb 6, 2019 8:20 PM UTC

Hello,

I would like to insert highlighted text from JPG images from Microsoft Azure Computer Vision OCR API.

Thanks for letting me know on the dpi for PDF.

I may need to create a formula.

Thank you.

Sincerely,

William Johnston

Translate