The following example demonstrates how to save the redacted document, replacing an original file:
// Make a copy of sample file Files.copy(New File("Sample.docx").toPath(), New File("OverwrittenSample.docx").toPath(), StandardCopyOption.REPLACE_EXISTING); // Apply redaction final Redactor redactor = New Redactor("OverwrittenSample.docx"); try { RedactorChangeLog result = redactor.apply(New ExactPhraseRedaction("John Doe", New ReplacementOptions(java.awt.Color.RED))); if (result.getStatus() != RedactionStatus.Failed) { SaveOptions options = New SaveOptions(); options.setAddSuffix(false); options.setRasterizeToPDF(false); // Save the document in original format overwriting original file redactor.save(options); } } finally { redactor....Consulting Blog Knowledge Base New Releases Status Websites aspose.... copy ( new File ( "Sample.docx" ). toPath (), new File ( "OverwrittenSample...