Skip to content

Instantly share code, notes, and snippets.

Remove Annotations from RTF using Java. For more information, please follow link: https://kb.groupdocs.com/redaction/java/remove-annotations-from-rtf-using-java/
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(); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment