import com.groupdocs.redaction.Redactor; import com.groupdocs.redaction.licensing.License; import com.groupdocs.redaction.options.SaveOptions; import com.groupdocs.redaction.redactions.DeleteAnnotationRedaction; public class RemoveAnnotationsfromRTFusingJava { public static void main(String[] args) throws Exception { // Set License to avoid the limitations of Redaction library License license = new License(); license.setLicense("GroupDocs.Redaction.lic"); final Redactor redactor = new Redactor("input.rtf"); try { redactor.apply(new DeleteAnnotationRedaction("(?im:(use|show|describe))")); SaveOptions options = new SaveOptions(); options.setAddSuffix(true); options.setRasterizeToPDF(false); redactor.save(options); } finally { redactor.close(); } } }