Skip to main content
Participant
September 21, 2021
Question

[PDF Embed API] Annotations are not saving for multi users

  • September 21, 2021
  • 1 reply
  • 983 views

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? 

    This topic has been closed for replies.

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    September 21, 2021

    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.

    Participant
    September 22, 2021

    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.

    Joel Geraci
    Community Expert
    Community Expert
    September 22, 2021

    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.