How to disable tool preselection

WebViewer Version: 11.7.1

Do you have an issue with a specific file(s)? no
Can you reproduce using one of our samples or online demos? no
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:
How to disable tool preselection

Please describe your issue and provide steps to reproduce it:
In the Annotate tab the erase tool is preselected, how to prevent it?

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 seems like you’re looking to disable the preselection of tools in the WebViewer, specifically preventing the erase tool from being preselected in the Annotate tab. By default, WebViewer might preselect a tool when the UI loads, but you can customize this behavior.

Some things you can try:


  • Use the setToolMode API to set the tool mode to null or another tool of your choice when WebViewer initializes.

  • Listen for the documentLoaded event to ensure the document is ready before changing the tool mode.

  • Customize the toolbar configuration to set the default tool mode according to your preference.




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.

Hi Jackson,

Thank you for reaching out.

If the eraser is selected, it means that Webviewer is selecting the last tool you used.

You can select another tool, such as the Pan Tool or Select Too,l like this:

UI.addEventListener(UI.Events.VIEWER_LOADED, () => {
    instance.UI.setToolMode(instance.Core.Tools.ToolNames.PAN);
})

Let me know if this works for you.

Best Regards,
Mickaël.