[Collaboration] How to show original document when edit the document in the previous opening

Hi PDFTron,
I am using CollabClient to share changed annotations and scroll in real-time. When I open the document, then edit it, it seems that every changed annotation is saved. When opening the document next time, the changed annotations saved in the previous edit is shown totally.
However, it isn’t suitable in my system because the document is just edited, not having any save action. Therefore, I wanna ask how to show the original document when opening it, even when the document was edited in the previous opening.

WebViewer Version: ^8.5.0

I used your demo to show the above problem, please watch the attached video:
https://drive.google.com/drive/folders/1yIQ0KMqABmc-ActzyqBqfuMornmFC-VS?usp=sharing

Thanh you.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hello Iris,

You can take a look at this guide on Prevent annotations from saving in database. This might suit your needs. You can also take a look at Permissions | WebViewer Real-time Collaboration to set permissions that only allow the document owner to edit the document. Let me know if this helped!

Best Regards,

Jimmy Lin

Software Developer

PDFTron Systems, Inc.

www.pdftron.com

CONFIDENTIALITY NOTICE: This message (and any attachment to it) is intended only for the use of the individual or entity to which it is addressed in the header, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any reproduction, distribution, modification or use of the contents of this message (and any attachment to it) by any individual or entity other than the intended recipient is prohibited. If you have received this communication in error, please notify us immediately and delete the original.

Hi JimmyLin,

Thanks for your solution but It seems not to help me to resolve my problem. The solution Prevent annotations from saving in database might support that the annotation should only be kept locally and not stored in the database. However, I still wanna sync the annotations when using CollabClient because I wanna other users can see the change in the document when the document is in a sync section.
Nonetheless, all the changes will be saved in the database and they will be shown in the next opening. My problem is: I just wanna show the original document when opening the document, I mean all the changes in the previous opening will not show in the recent opening. How can I do that? Can you give me another solution?

Thank you.

Hi JimmyLin,

Thanks for your solution but It seems not to help me to resolve my problem. The solution Prevent annotations from saving in database might support that the annotation should only be kept locally and not stored in the database. However, I still wanna sync the annotations when using CollabClient because I wanna other users can see the change in the document when the document is in a sync section.
Nonetheless, all the changes will be saved in the database and they will be shown in the next opening. My problem is: I just wanna show the original document when opening the document, I mean all the changes in the previous opening will not show in the recent opening. How can I do that? Can you give me another solution?

Thank you.

Hi Iris,

You can probably set custom roles to only allow certain users to be able to read annotations: Permissions | WebViewer Real-time Collaboration

import CollabServer from '@pdftron/collab-server';

const whitelist = [
 'joe@email.com',
 'bob@email.com'
]

const server = new CollabServer({
 ...otherOptions,
 permissions: {
   [CollabServer.Permissions.Entities.ANNOTATION]: {
     [CollabServer.Permissions.Actions.READ]: (document, userId) => {
       const user = await myDB.query(`SELECT * FROM users WHERE id = ${userId} LIMIT 1`);
       const { email } = user;
       return whitelist.includes(email);
     }
   },
 }
});

So that certain users can’t see annotation changed

Best Regards,

Jimmy Lin

Hi Jimmy Lin,

It seems that it is not my wish to resolve the problem. My problem is not which user can see the annotation or not. My problem is not saving the annotations in the database when using Collab Client, I mean each time opening the document, then edit something, then close the document, all the added annotations will be removed from the document. Do you have any other ideas?

Thank you.

Hi Iris,

Unfortunately, we didn’t support this situation at the moment. We’ve added the feature to our backlog to be worked on in the future. We don’t have a timeline for when it will be available but if it does get worked on we’ll let you know when it’s available in an experimental build to test out and the estimated official release date.

Best,

Jimmy Lin