Problem with CustomApplyRedactionsHandler

Hi !
I want to have some custom logic when clicking on the ‘Redact All’ button. I tried to use CustomApplyRedactionsHandler . But I get this error:

Uncaught (in promise) TypeError: instance.UI.setCustomApplyRedactionsHandler is not a function


  .then(function(instance) {
    instance.UI.setCustomApplyRedactionsHandler((annotationsToRedact, originalApplyRedactionsFunction) => {
      // custom code

My code:

window.webviewerFunctions = {
    initWebViewer: function () {
        const viewerElement = document.getElementById('viewer');
            path: 'lib',
            initialDoc: '', // replace with your own PDF file
            fullAPI: true,
            enableRedaction: true
        }, viewerElement).then((instance) => {

            instance.UI.setCustomApplyRedactionsHandler((annotationsToRedact, originalApplyRedactionsFunction) => {

                console.log("My logic comes here!");


Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hello @traderaboy

I’ve tried to reproduce the issue on WebViewer 8.5 (The version that introduced the API), but I could not. What’s the WebViewer version you are using?

Hello @dfelix
We used WebViewer version 8.4.1. But we upgraded to WebViewer 8.5 and it works now.
Thank you.