mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.25k stars 9.96k forks source link

Pdf.js Annotations #8562

Closed kbaranovska closed 7 years ago

kbaranovska commented 7 years ago

Hi, maybe it isn't proper channel to ask - but I am interested in implementing Pdf.js Annotations for pdf.js viewer, but can't find examples how to do it correct. I saw some implementations and supporting several types of annotation in the github repo. Are there any description how to integrate annotations in viewer?

Thank you.

timvandermeij commented 7 years ago

Take a look at the example at https://github.com/mozilla/pdf.js/blob/master/examples/components/pageviewer.js#L50. It activates the annotation layer when drawing the canvases. If you use the default viewer as a base, there is https://github.com/mozilla/pdf.js/blob/master/web/annotation_layer_builder.js.