0

I'm drawing a rectangle over a PDF in Javascript (rendered with via the PDF.JS library) that, subsequently, with a specific elaboration, will be printed in the PDF in the same position (I'm using 2 stacked canvas to do the trick). How can I be sure that the pixels that have been obtained by the rectangle drawing will match the PDF pixels? Should I obtain the PDF pixels via PDF.JS to render the correct canvas area where the rectangle will be draw?

andreasperelli
  • 1,034
  • 2
  • 11
  • 40
  • The question is unclear. Yet you might merge the document image canvas with the drawing overlay canvas and then save to PDF. For ideas see: [drawing images on 3 layer canvas and saving](https://stackoverflow.com/questions/17554168/drawing-images-on-3-layer-canvas-and-saving/17555283#17555283) – Yogi Oct 13 '22 at 09:58

0 Answers0