Home > front end >  PDF, JS, how to win the PDF document coordinates of the mouse to click
PDF, JS, how to win the PDF document coordinates of the mouse to click

Time:05-02

Using PDF. Js viewing PDF files, there is a demand at present: the location of the need to use the mouse to click on the PDF, the location of click it, insert a picture, the background is itextpdf, insert images function is ready, now the question: how is in the foreground, taking out the mouse to click the PDF document location, note: is the location of the mouse click on the PDF document, not the location of the mouse click element! Now all the information online is the location of the mouse click on the element, I cut a figure, the great god of all stripes, please help!

CodePudding user response:

refer to the original poster ysjydss response:
use PDF. Js viewing PDF files, there is a demand at present: the location of the need to use the mouse to click on the PDF, the location of clicking on it, insert a picture, the background is itextpdf, insert the image function is ready, now the question: how is in the foreground, taking out the mouse to click the PDF document location, note: is the location of the mouse click on the PDF document, not the mouse to click the position of the element. Now all the information online is the location of the mouse click on the element, I cut a figure, the great god of all stripes, please help!


You get the position of elements, combined with the current scroll position, can't calculate the true location?