Does Aspose.Cells provide redactions or redaction labels?

I attached a GIF. In the cell, I’m filling it with black color. Is there any way to write text on top of the black background ?

Note : Here we don’t want to uses any shapes and controls
We don’t want to use text box controls.

2025-07-08_07h06_25.gif (1.2 MB)

@sarathepiq
just change the cell font color to white ,then the text will show

As shown in the attached GIF, I am able to fill the cell with black color. On top of that, I can add new text in white color.

I want to perform same thing in aspose cells with out shapes and controls.

redations.gif (705.1 KB)

@sarathepiq
when you apply the redaction.
here we can see it just set backgroundColor to black.
so we can record the origin cell text and cell font color and the cell backgroundColor.
after it set backgroundColor to black. we just set cell text to the wanted text and the font color to white. then it will show the white text .
later if you remove the redaction. you just restore the backgroundColor ,the cell text and the cell font color.

Here, we don’t want to modify the original file content — meaning we don’t want to remove or overwrite the original text.

@sarathepiq
when click the download button, just do the remove redaction. then the original text is restore back.
otherwise ,I have no idea how to achieve such effect.

Am I need to manually remove the redactions ? is there any option in aspose cells to remove the redactions?

@sarathepiq
you can implement it using the JS APIs.
Just wait ,we will give you the sample code soon.

Don’t we have any direct way for redactions and redaction reasons ?

@sarathepiq
you can run the highlight demos in github.
we have the highlight APIs ,but it effect is not same as your requirement. here we just set background color, we don’t change the font color.

highlight.png (5.8 KB)

@sarathepiq
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSGRIDJS-1766 Support set font color for highlight API

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@sarathepiq
using the latest v25.7 client js
You can use the code below to mimic the redaction effect:

 //redaction test
 const reditems = [];

 function redaction(ri, ci, redactionFontColor, redactionBgColor, redactionText)
 {
     const cell = xs.sheet.data.getCell(ri, ci);
     const reditem = {
         ri,
         ci
     };
     if (cell)
     {
         reditem.originText = cell.text;
         const style = xs.sheet.data.getCellStyle(ri, ci);
         reditem.originColor = style.color;
         reditem.originBgColor = style.bgcolor;

     } else
     {
         //empty cell
         reditem.originText = '';
         reditem.originColor = 'black';
         reditem.originBgColor = 'white';

     }
     reditems.push(reditem);
     //change to redaction
     xs.sheet.data.setCellText(ri, ci, redactionText);
     const range = {};
     range.sri = ri;
     range.eri = ri;
     range.sci = ci;
     range.eci = ci;
     xs.sheet.data.setRangeAttr(range, 'bgcolor', redactionBgColor);
     xs.sheet.data.setRangeAttr(range, 'color', redactionFontColor);
     xs.reRender();

 }

 function removeAllRedAction()
 {

     reditems.forEach((item) =>
     {
         const {
             ri,
             ci,
             originText,
             originColor,
             originBgColor
         } = item;
         const range = {};
         range.sri = ri;
         range.eri = ri;
         range.sci = ci;
         range.eci = ci;

         // xs.sheet.data.deleteRange(range, 'all');
         xs.sheet.data.setCellText(ri, ci, originText);
         xs.sheet.data.setRangeAttr(range, 'bgcolor', originBgColor ?? 'white');
         xs.sheet.data.setRangeAttr(range, 'color', originColor);


     });
     reditems.length = 0;
     xs.reRender();

 }

 function mybeforeSave()
 {
     removeAllRedAction();
     console.log('before save remove redaction and restore the cell text');
     return true;
 }
//set function call before click download happen
xs.setBeforeSaveFunction(mybeforeSave);