Viren
Viren

Reputation: 5962

Is there way to write javascript events for pdf render using pdf.js

I have a scenario where I been asked to make online PDF viewer and on viewing mode the user would select certain area of the PDF and upon selection the marked area boundary w.r.s.t pdf should sent to the server.

example If the User click a area of say created at date the boundary of the selected area should be sent to the server

Now I googled around, and I found that Pdf.js can handle the rendering of pdf in browser. Can I, by any chance, associate the event with the PDF pages as I mention above or should I look for some other solution like flash

Regards

Upvotes: 3

Views: 725

Answers (1)

Kristof Mols
Kristof Mols

Reputation: 3557

In the viewer.js, there are some listeners like:

  • window.addEventListener('mousedown', function mousedown(evt) {..}
  • window.addEventListener('mousemove', function keydown(evt) {..}

You can use those to do the logic of your dragging, selecting, ..

Upvotes: 1

Related Questions