Currently im working on displaying PDF file on website with React ts. Im using pdf-lib to work with PDF file. What im looking for is how to display the pdf file on canvas so I can draw boxes or objects overlaying the pdf page. I’ve tried react-pdf to display the file on but it seems to be uneditable. Do u guys have any suggestion?
2
Answers
I don’t know if this helps but that could be a lead to help you dig deeper.
So i suggest you to use the konvajs lib, you will need to convert your pdf to image or HTML to be able to use the drawing of konva
PDF-lib has the ability to add PDF annotations such as Text Boxes (i.e. Acrofields) and thus add textual annotations. It also has the ability to draw directly in a PDF objects, like circles when they are pre defined.
However, it is not a GUI PDF editor and is very clear on interaction:-
Although it is old and not a maintained lib you can see some nice simpler examples around the web such as https://github.com/ravisr/reactjs-image-annotation However that would not translate into a PDF underlay.
What you need is probably a commercial library as supported by a large team of programmers, such as Apryse https://pdfjs.express/documentation/react