Hi, I'm writing a react app where users may add annotations to a pdf which is being hosted in Dropbox. My problem is when there are multiple users accessing the file only one user can save the annotations and the annotations from other users are being ignored. Any ideas? Also, is it possible to show annotations from other users in real time?
It's possible to show annotations from other users but you'd need to build out the back end to manage them. Without such a back end, you won't be able to have multiple users update a PDF with annotations because the PDF on the client isn't synchronizing with the PDF in Dropbox, it's overwriting it... assuming you are saving back to Dropbox using the Save API.
Yes you assumed right. I can do the backend if needed, but not sure what I'm supposed to do. Should I save the annotations in json, save to backend, then load when the user views the pdf? But how do I save it to the pdf? Is it easier to restrict other users when someone is currently annotating the pdf? Thanks so much for your insights.
You're on the right track. If I were building such a solution, I'd never modify the original PDF. My backend would store information about the locations of any PDF files that were under review and have "side-car" files (or data somewhere) that represented the annotations for each user. I'd them have some code on the front end that would detect if a PDF file that got opened was one that had managed annotations and import them on demand for each session saving only the annotation changes and not modifying the underlying PDF.
But how do I embed all the managed annotations into the reviewed pdf in the end? Lastly, I noticed that there's a delay between the client pdf and the pdf saved in Dropbox, say I put some annotations (autosave enabled) then refresh the page - the pdf in Dropbox is updated instantly but the pdf in the client takes a couple of refresh before the updated annotations appear, any idea? Thanks so much!