Skip to main content
Participant
February 28, 2020
Answered

Ho to get annotation X & y position in java script

I am trying to get annotation x y position. pdf js conver xy position to rectangle.i  need x y position of annotaion layer.

This topic is closed to new replies. Start a new post to keep the conversation going.
Thom Parker
Thom ParkerCorrect answer
Community Expert
February 29, 2020

This article covers everything you ever wanted to know about annotation coordinates:

https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm

 

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

4 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
February 29, 2020

This article covers everything you ever wanted to know about annotation coordinates:

https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
February 28, 2020

Most comment types have a rect property which provides you their location directly. Others have a quads array, or an array of point objects. It all depends on the type of comment...

Translate
Thom Parker
Community Expert
Community Expert
February 29, 2020

All annotations have a "rect" property. It can't be used to set coordinates in many cases, but it's always there for getting the coordinates. 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Inspiring
February 28, 2020

It really depends on the type of annotation and how you define the "x y position" of a 2-dimensional object exactly. Some can be quite large and shaped irregularly. What types of annotations will you be dealing with?

Translate