Custom Redaction presets

Mark,

I may have misunderstood your question and thought you were referring to the preset redaction search patterns in our redaction panel.

If you just need to change the presets of the Redaction tool you can use the setStyles API.

The viewer ships with four instances of the tool (four tools shown in the tools preset) - let’s say you wanted to change the default text for the first one. This is how I would achieve that:

 const { documentViewer, Annotations, annotationManager, Tools } = instance.Core;

  const redactionTool = documentViewer.getTool(Tools.ToolNames.REDACTION);
  redactionTool.setStyles({
    OverlayText: 'My Text'
  });

The styles object also accepts properties like StrokeColor etc. I’ll leave my first response up in case you find it useful, but let me know if I actually got it right this time.

Best Regards,
Armando Bollain
Software Developer
PDFTron Systems, Inc.