Hi,
can anyone tell me how to get coordinates in pdf document using javascript, suppose if some text is written in pdf document then how can i get coordinates(x,y) of that text. Please help me.
Hi,
can anyone tell me how to get coordinates in pdf document using javascript, suppose if some text is written in pdf document then how can i get coordinates(x,y) of that text. Please help me.
Its very Urgent.
It is of no interest how urgent a task is for your work, because we're not being paid to do your job. SO is here to promote learning.
suppose if some text is written in pdf document then how can i get coordinates(x,y) of that text
Assuming you are talking about JavaScript embedded in a PDF document, my understanding is you don't get access to the full document text. If you want to find the position of one particular bit of the text, you could, however, add an annotation to it, and then access its rect property:
var doc= this; // or however you are accessing it
var annot= doc.getAnnot(0, 'AnnotationName');
var left= annot.rect[0];
var bottom= annot.rect[1];
var right= annot.rect[2];
var top= annot.rect[3];