applyRedactions API does not return

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

Please give a brief summary of your issue:
(Think of this as an email subject)
applyRedactions API does not return.

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

I am developing Redact.
Read RedactAnnotation(xfdf) from DB and display it on the screen.
ApplyRedactions immediately after that.
Processing is not returned.

sample code.

protected viewerInstance: WebViewerInstance;

protected Initialize(): void {
  webviewer({fullAPI: true, enableRedaction: true, ...})
    .then((instance: WebViewerInstance) => {
      this.viewerInstance = instance;
      documentViewer.addEventListener('documentLoaded', () => {

protected onDocumentLoaded(): void {
  const xfdfs = DB.getAnnotationXfdfs();

  await Promise.all( ........
      const annot = await this.viewerInstance.Core.annotationManager.importAnnotations(xfdf);
      await this.viewerInstance.Core.annotationManager.redrawAnnotation(annot[0]);

  const redactionList = this.viewerInstance.Core.annotationManager
        (annot) =>
          annot instanceof
  console.log('redactionList.length = ' + redactionList.length);

    try {

      const aaa =
      console.log('aaa = ' + aaa);

      const bbb =
      console.log('bbb = ' + bbb);

      const rtn =
        await this.viewerInstance.Core.annotationManager.applyRedactions();

    } catch (error) {



(ApplyRedactions() may return very occasionally.)

Am I using applyRedactions() incorrectly?

Best Regards.

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

Hello okabe.yasufumi,

We have a guide available on how to use the applyRedactions API here: Apryse Documentation | Documentation

I haven’t been able to reproduce this issue using our redaction sample here: JS PDF Redaction Demo | Apryse WebViewer

The steps I took to see if the return value was working were:

  1. draw several redactions on the page
  2. enter the following into the browser console in the “webviewer-1” context:
test = await instance.Core.documentViewer.getAnnotationManager().applyRedactions()

  1. get the return value with the correct number of redaction annotations in the console

You mentioned that “ApplyRedactions() may return very occasionally.” Can you explain the steps that you take when you are able to get the return to appear and any differences in when it does not?

Best Regards,

Carlo Mendoza
Web Developer

Hello cmendoza,

You mentioned that “ApplyRedactions() may return very occasionally.” Can you explain the steps that you take when you are able to get the return to appear and any differences in when it does not?

About 1 out of 5 times it worked.
There is no difference in the verification procedure.
(I’m using Angular 14.)

I bumped the version from 10.1.0 to 10.2.3.
And I tried 10 times, all successful.

But the changelog doesn’t mention this issue.
Was it fixed by some modification?

Best Regards.

1 Like

Hello okabe.yasufumi,

Looking at our changelog for version 10.2.2, there were several improvements to redaction made. It seems like most were done on the UI side but they could have also resulted in fixes to the issue you were seeing in 10.1.0.

Please let us know if you still find any issues with getting redactions to apply.

Best Regards,

Carlo Mendoza
Web Developer

1 Like