// Mở tệp của bạn
final Redactor redactor = new Redactor("source.pptx");
try
{
// Thêm một mẫu regex EMAIL và nội dung thay thế
ReplacementOptions repl_opt = new ReplacementOptions("[redacted]");
String emailRegex = "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}";
RegexRedaction redaction = new RegexRedaction(emailRegex, repl_opt);
// Áp dụng quy tắc xóa dựa trên mẫu
redactor.apply(redaction);
// Lưu phiên bản đã dọn dẹp
SaveOptions saveOptions = new SaveOptions();
saveOptions.setAddSuffix(true);
saveOptions.setRasterizeToPDF(false);
redactor.save(saveOptions);
}
finally { redactor.close(); }