Please give a brief summary of your issue: Detect any pdf modifications
Please describe your issue and provide steps to reproduce it:
I try to detect any kind of modifications on a document to implement a “Do you discard modifications?” message if a user modified a document and leave the editor. But I’m not sure if i detect all possible modifications at the moment.
There isn’t a single event that you can listen to for this. Likely you would need to listen to multiple events. Here are some events that may be what you are looking for: annotationChanged fieldChanged layoutChanged
Let me know if there are any issues.
Ahmad Moaaz
Software Developer
PDFTron Systems, Inc. www.pdftron.com
thanks for your response.
I just try it but I get the following effect:
If I open a huge linearized document, I can already add annotations before the document and the annotations is fully loaded. This triggers annotationChanged with action add. As I expected it.
But I get also the same event, if I just open a document with existing annotations. So I can’t detect if a user added the annotation or it is a existing and unchanged annotation.
The annotationChanged event passes an info object to the callback which contains the imported property. If imported is true then this change was most likely triggered from within the document itself. You can check for that property and ignore the event in that case.
Let me know if there are any issues.
Best Regards,
Ahmad Moaaz
Software Developer
PDFTron Systems, Inc. www.pdftron.com