The following example demonstrates how to save file in its original format with current date as a suffix:
constredaction=require('@groupdocs/groupdocs.redaction');constredactor=newredaction.Redactor('sample.docx');try{// Here we can use document instance to perform redactions
redactor.apply(newredaction.ExactPhraseRedaction('John Doe',newredaction.ReplacementOptions('[personal]')));constsaveOptions=newredaction.SaveOptions();saveOptions.setAddSuffix(true);saveOptions.setRasterizeToPDF(false);saveOptions.setRedactedFileSuffix(newSimpleDateFormat('dd-MM-yyyy').format(newDate()));// Saving in original format with date as DateTime.getNow().toShortDateString()a suffix
redactor.save(saveOptions);}finally{redactor.close();}
sample.docx is the sample file used in this example. Click here to download it.