The following example demonstrates how to save file in its original format with current date as a suffix:
finalRedactorredactor=newRedactor("sample.docx");try{// Here we can use document instance to perform redactions
redactor.apply(newExactPhraseRedaction("John Doe",newReplacementOptions("[personal]")));SaveOptionssaveOptions=newSaveOptions();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.