How to completely hide "Include annotations" option from WebViewer Print modal

I am using WebViewer with Modular UI and fullAPI enabled.

I have added a custom Flyout containing PresetButtons for “Print” and “Save As”.
The Print button correctly opens the default WebViewer Print modal.

My goal is to completely remove certain options from the Print modal UI:

  • “Include annotations”
  • “Watermark” “Add New“

I was able to remove the watermark option using:
instance.UI.disableElements([‘printWatermark’]);

However, the “Include annotations” checkbox does not have a data-element attribute,
so disableElements does not work for it.

I also tried:

  • instance.UI.setDefaultPrintOptions({ includeAnnotations: false })
  • instance.UI.disableTools(…)

These APIs only change the default state or behavior, but the option is still visible in the Print modal UI.

Since the Print modal is rendered inside an iframe, parent-level CSS does not apply, which also makes it difficult to hide the option via styling.

My question:
Is there an official, API-supported way to completely hide or remove Print modal options that do not have a data-element attribute, specifically the “Include annotations” option?

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.


You’re dealing with the challenge of hiding specific options from the WebViewer Print modal, particularly the “Include annotations” option, which cannot be disabled using the typical disableElements method due to the absence of a data-element attribute.

Some things you can try:

  • Consider using custom CSS to target elements within the iframe by injecting the CSS directly into the iframe’s document.

  • Use the setPrintHandler method to customize the print behavior and potentially bypass the default Print modal, creating a custom print flow without the undesired options.

  • Explore the possibility of customizing the Print modal UI using the Modular UI framework to remove or alter the modal directly.



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 Ethan,

Thank you for reaching out.

You have 3 options to remove this element.

1 - We submit a feature request to add a proper data element

2 - You can fork the UI, remove this element from the modal and build this UI, and implement it in your project.

You can find the repo here: GitHub - ApryseSDK/webviewer-ui: WebViewer UI built in React
The specific file you want to update is ​webviewer-ui/src/components/PrintModal/PrintModal.js at 87cfabec39c0cfa53768a1edfa7601dd7f7b7cd3 · ApryseSDK/webviewer-ui · GitHub

After making your changes, you will need to build the UI and integrate it with your WebViewer instance. For guidance on building and integrating the custom UI, please refer to our advanced customization guide here: https://docs.apryse.com/web/guides/advanced-customization

3 - You can use the event “visibilityChanged” to detect when the print modal is opened, access the DOM, and remove the element directly:

instance.UI.addEventListener('visibilityChanged', (e) => {
    if (e.detail.element === "printModal") {
        console.log('visibilityChanged', e)
        let form = document.querySelector("#wc-viewer").shadowRoot.querySelector("#app > div.App.is-web-component > div.Modal.PrintModal.open > div > div > div.settings > div:nth-child(1) > form")
        const checkboxes = form.querySelectorAll('input[type="checkbox"]');

        if (checkboxes.length > 0) {
            checkboxes[0].closest('.ui__choice').remove(); // remove the first checkbox
        }
        if (checkboxes.length > 1) {
            checkboxes[checkboxes.length - 1].closest('.ui__choice').remove(); // remove the last checkbox
        }
    }
});

Let us know if you would like to submit a feature request.

Best Regards,
Mickaël.

1 Like

Thank you for your detailed explanation and the different options.

I managed to make it work using the shadowRoot approach, and it works perfectly on my side now.

Thank you very much for your help

Best regards,