Last active
August 18, 2024 08:49
Remove Annotations from RTF using Java. For more information, please follow link: https://kb.groupdocs.com/redaction/java/remove-annotations-from-rtf-using-java/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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