Version 26.11 introduces updated evaluation mode limitations.
Without a license, a single process can open up to 25 documents. The previous limits of 1 document, 1 redaction, and 4 replacements no longer apply. Trial badges are still added to saved documents.
License.isLicensed()
License.isLicensed() returns true when a valid license has been applied, and false when the component is running in evaluation mode.
OCR types moved to com.groupdocs.redaction.integration.ocr
The following types were moved from com.groupdocs.redaction.integration to com.groupdocs.redaction.integration.ocr:
IOcrConnector
RecognizedImage
TextLine
TextFragment
Update imports in custom OCR connectors and related code:
// Before (26.10 and earlier)
importcom.groupdocs.redaction.integration.IOcrConnector;importcom.groupdocs.redaction.integration.RecognizedImage;importcom.groupdocs.redaction.integration.TextLine;importcom.groupdocs.redaction.integration.TextFragment;// After (26.11)
importcom.groupdocs.redaction.integration.ocr.IOcrConnector;importcom.groupdocs.redaction.integration.ocr.RecognizedImage;importcom.groupdocs.redaction.integration.ocr.TextLine;importcom.groupdocs.redaction.integration.ocr.TextFragment;
Pre-rasterize output location
LoadOptions.PreRasterize and formats that require rasterization now save the PDF next to the source file. Previously the PDF was written to the process working directory.
Why To Migrate?
Here are the key reasons to use the new updated API provided by GroupDocs.Redaction for Java since version 19.6:
Redactor class introduced as a single entry point to manage the document redaction process (instead of Documentclass from previous versions).
Methods redactWith() of the Document class were replaced with similar apply() methods in Redactor class.
Method Document.save(OutputStream, SaveOptions) was replaced with Redactor.save(OutputStream, RasterizationOptions).
Constructor LoadOptions(DocumentFormatConfiguration) was removed.
RedactionSummary was renamed into RedactorChangeLog, RedactionLogRecord into RedactorLogRecord, MetadataFilter into MetadataFilters.
Obsolete members were removed from Public API.
Added a number of new exception classes and base exception class for GroupDocs.Redaction exceptions.
How To Migrate?
The following example demonstrates how to redact Microsoft Office Word document and dumping statuses of applied redactions using old and new API:
Old coding style
// Load the file
Documentdoc=Redactor.load("Documents/Doc/sample.docx");//Perform redaction using exact phrase
RedactionSummarysummary=doc.redactWith(newExactPhraseRedaction("John Doe",newReplacementOptions("[Personal]")));for(RedactionLogEntryentry:summary.getRedactionLog()){System.out.println(entry.getStatus());}//Save the resultant document
doc.save();// Close the Document
doc.close();
New coding style
// Load the file
Redactorredactor=newRedactor("Documents/Doc/sample.docx");//Perform redaction using exact phrase
RedactorChangeLogsummary=redactor.apply(newExactPhraseRedaction("John Doe",newReplacementOptions("[Personal]")));for(RedactorLogEntryentry:summary.getRedactionLog()){System.out.println(entry.getResult().getStatus());}//Save the resultant document
redactor.save();// Close the Redactor
redactor.close();
For more code examples and specific use cases please refer to our Developer Guide documentation or GitHub samples and showcases.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Ask AI
Ask anything about this page — the answer is based on its content.
Searching the docs and writing an answer…
Something went wrong while getting an answer. Please try again in a moment.