When I redact rtf file attached I am getting the replacement text 3 times though there is only one word is in the document. Please remove .pdf
extension from file names as it can’t be uploaded with .rtf extension.
Redaction test details:
Original file: One Two Three Four Pattern_Feb14th_001.rtf.pdf (23.5 KB)
Redacted file: redacted-file.rtf.pdf (943.9 KB)
Groupdocs redaction version: 21.12
@Test
void redactRtfDuplicates() throws Exception {
try (InputStream indoc = getClass().getResourceAsStream("/One Two Three Four Pattern_Feb14th_001.rtf");
OutputStream outDoc = Files.newOutputStream(new File("redacted-file.rtf").toPath());
Redactor redactor = new Redactor(indoc)) {
redactor.apply(new RegexRedaction("ALWPG5809L", new ReplacementOptions("[Secret]")));
RasterizationOptions ro = new RasterizationOptions();
ro.setEnabled(false);
redactor.save(outDoc, ro);
}
}