Webviewer in readonly mode still allows editing of outlines

WebViewer Version: 11.7.3

Do you have an issue with a specific file(s)? no
Can you reproduce using one of our samples or online demos? yes
Are you using the WebViewer server? no
Does the issue only happen on certain browsers? no
Is your issue related to a front-end framework? no
Is your issue related to annotations? no

Please give a brief summary of your issue:
If the editor is put into readonly mode, there are still things that can be edited.

Please describe your issue and provide steps to reproduce it:
go to a demo
issue the console command: WebViewer.getInstance().UI.getDocumentViewer().enableReadOnlyMode()
Change to the outlines tab in the left panel
observe that they can still be edited

Also, I got it to let me drag the thumbnails around after being in readonly mode. I’ve tried to reproduce that one, but I cant repro it. I did get a console message “Permission: rast” around the time that happened though, if that makes any difference.

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It appears you’re experiencing an issue where the readonly mode in WebViewer doesn’t fully restrict editing capabilities, specifically with outlines and thumbnails. This might be due to the readonly mode not affecting certain elements like the outlines tab or the thumbnail panel.

Some things you can try:

  • Verify that the readonly mode is correctly initialized by checking if enableReadOnlyMode() is being called after the document has fully loaded.

  • Ensure that any custom scripts or UI modifications aren’t interfering with the readonly settings.

  • Consider programmatically disabling specific UI components (like the outlines tab) if readonly mode doesn’t cover them.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.

Hello Patrick,

Thank you for contacting Apryse Forums.

You can use enableReadOnlyMode on annotationManager to prevent outlines from being edited.

instance.Core.annotationManager.enableReadOnlyMode();

Regarding the thumbnails issue, since you were only able to reproduce it once, it may have been a one-off occurrence. Perhaps some code changes weren’t saved when the issue occurred. If the issue cannot be consistently reproduced on your side or ours, unfortunately, we won’t be able to address it.

Best Regards,
Darian

Hi Darian, that doesn’t actually disallow outline editing. I issued this command in the console (in addition to the one in my initial post: WebViewer.getInstance().Core.annotationManager.enableReadOnlyMode()

and nothing changed. I can still add and edit outlines.

Additionally I can add and edit bookmarks on your demo under those conditions, though we disable that element in our actual implementation.

Hello Patrick,

Apologies for the confusion. These APIs do not affect outlines or bookmarks.

The disableElements API can be used to hide a few of these elements.

instance.UI.disableElements(['addNewOutlineButton',  'outlineMultiSelect']);

For the edit button on the outlines, you can follow this guide to add custom CSS to WebViewer.

Add this to your css file to hide those buttons.

button[data-element^="outline-more-button"] {
  display: none;
}

Best Regards,
Darian

1 Like