We want to develop functionality for discarding an annotation and restore the discarded annotation.
- Is there any way to achieve this directly with PDFTron customization.
2.1) In the ‘notesPanel’ for annotations listed we have ‘NotePopup’ with edit and delete option. How can I add another option (say discard/restore in our scenario) ?
2.2) In the ‘notesPanel’ can I add a button to filter the annotations (say display discarded annotations only) ?
** How can I keep the ‘notesPanel’ back to left side **
Note - I am working with XFDF.
This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately by e-mail or phone and delete it from their system without making any copies or disclosing it to a third person. BRIDGEi2i Analytics Solutions reserves the right to store, monitor and review the content of all messages sent to or from this email address.
This definitely is possible to implement. You can listen to the annotationChanged event on the annotation manager. The action you are looking for is perhaps the delete action as I assume that is how you will be discarding annotations. The deleted annotation will be passed into the event which you can then pass to exportAnnotations to get the XFDF just for that annotation. You can keep this XFDF and import it when it is restored via importAnnotations.
Alternatively, you should potentially “discard” annotations by hiding them on the page and from the notes panel. The properties you would be looking to toggle on the annotation are Hidden and Listable. You could also try setCustomNoteFilter to filter out the non-discarded ones or vice versa: https://www.pdftron.com/api/web/WebViewerInstance.html#setCustomNoteFilter.
Regarding your next few questions, you will most likely need to customize the open-source UI: https://github.com/PDFTron/webviewer-ui. If you are using the legacy UI (version 5.0-6.3), then you will have to use the branch that is approximately associated with that version. For example, if you are using WebViewer 6.3.6, then you should customize the 6.3 UI branch. If you are on WebViewer 7.0, you could consider using the setCustomPanel API that adds a new panel to the left: https://www.pdftron.com/api/web/WebViewerInstance.html#setCustomPanel__anchor. You can use this for your customizations but you may have to implement your own search and sort if you plan to implement your own notes panel and disable the default one.
PDFTron Systems Inc.
The setCustomPanel API is available in 6.3 as well. Sorry for the confusion!
PDFTron Systems Inc.