This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/web/user-interface/main-toolbar/hide-the-toolbar.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Hide toolbar in JavaScript PDF viewer | Nutrient SDK

By modifying the ViewState, you can control when the toolbar should be shown or hidden by using the showToolbar property.

Launch Demo

By updating this property using the instance.setViewState(), the toolbar will be shown when the property is set to true and hidden when set to false.

The following example toggles the showToolbar property between both states, so it will show it if it’s hidden, and hide it if it’s visible:

instance.setViewState(viewState => viewState.set("showToolbar", !viewState.showToolbar));