Tested Version: WebViewer Version: 11.4.0 without Server Backend
I have built a product-specific editor based on the Apryse Webviewer, which tracks the annotations based on the AnnotationManager events and reacts accordingly. This works perfectly so far. However, as soon as I start the reader mode via toggleReaderMode(), no more events seem to be fired. As soon as I leave reader mode, the events are fired again. The annotations created in reader mode are still visible, but unfortunately do not appear in the events (AnnotationModified).
Edit:
I have to correct myself here:
The annotations appear as an event, but with the imported=true flag.
Is there a special version of the Annotation Manager in Reader Mode or am I possibly making another mistake?
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
It seems you’re experiencing issues with the AnnotationManager events not firing when in reader mode in Apryse WebViewer. Reader mode is designed for a distraction-free reading experience, which might limit certain interactive features such as annotation event tracking.
Some things you can try:
Check if reader mode is affecting the event listeners. You might need to manually reattach event listeners when entering reader mode.
Investigate if reader mode alters the AnnotationManager’s behavior. If so, you might need to implement a workaround to track annotations separately while in reader mode.
Consider toggling off reader mode when annotation interactions are necessary, or handle annotations differently when in reader mode.
Use the API to check if reader mode has specific configurations that could be affecting event firing.
WebViewer does act differently when ReaderMode is enabled. When enabled, we extract the reflowable layout of each page in a PDF document as HTML format, and then combine them into one single view. (For more information, see our guide on Reader Mode here).
Since we are working with the extracted content but not the exact document, any annotation changes made here will not trigger the usual annotationChanged event. Instead, we limit support to only text annotations (as we can link them to text content that will likely change position), and sync any changes upon exiting (hence why the annotationChanged event is fired after exiting with imported=true, it is indeed reimporting the annotations).
After reviewing the documentation, this does not appear to be well documented, and we can understand the confusion. I’ve raised a request to update the documentation to include more information about annotation behavior. If there is any feedback you would like to provide regarding this, feel free to reach out.
Let us know if you need further clarification.
Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer Apryse Software Inc.
We really like the reader mode and this feature is very useful to fulfill accessibility requirements by the European public sector.
Is it possible to “Tag” the Annotation Changed events with a source information? Like the source attribute for “draggingAcrossPages”.
In this case, I may identify the import events correctly and handle these events accordantly. Currently, the events are identical to the initial events when the document getting opened.
Is it also possible to add events when switching to and from reader mode to normal mode? I would like to reduce the custom UI in reader mode to the available functions. Or make the ToggleReaderMode function async?