0

I am trying to provide pan functionality as well as the ability to clear the page when annotations are made with https://github.com/wojtekmaj/react-pdf. I am using https://codesandbox.io/s/react-typescript-zoom-pan-html-canvas-p3itj?from-embed=&file=/src/index.tsx by robinovitch61's work as my basis for panning.

However, I can't seem get the canvas to pan. Is this because the canvas is not "draggable"?

Also, when I draw annotations and use .clearRect() it makes the whole canvas black rather than just clearing the shapes. Is there a way to re-render the same page to act as a "clear" function?

Thanks!

usagibear
  • 303
  • 3
  • 12

0 Answers0