Search code examples
pdfwebtextselection

How to make marks on pdfs texts and add comments to it?


I’m developing a system with php to essay’s correction. The student sends an essay in pdf and I have to make, someway, marks on this text to add comments (corrections) in it. For example, mark/select a paragraph and comment something about it. When the user click or pass de mouse up on the mark on the text, the respective comment/correction will be showed. My difficulty is to make the marks/selections on the pdf’s text and map this to add the comments and corrections. Has someone any idea of how this could be implemented?


Solution

  • Oh, that's a tought question boy. I faced the same problem months ago until I found a library called Fabric.js. It will help you to add annotacions and whatever you want over an image file. What about pdf? There is a similar solution which uses that same fabricjs as its core. Check it out: https://github.com/RavishaHesh/PDFJsAnnotations