Great news for .NET developers! GroupDocs.Redaction for .NET 23.8 (DLLs only) is here, and it delivers refined redaction features for developers. This update simplifies redaction in Arabic documents and introduces better control over redacting specific regions within PDF files.
Accurate Arabic Text Redaction
Ensure precise redaction of confidential information in Arabic documents with the latest C# redaction API release. It brings right-to-left text direction support for conveniently redacting Arabic content, as demonstrated in this coding example.
using (Redactor redactor = new Redactor("Arabic.pdf"))
{
ExactPhraseRedaction red = new ExactPhraseRedaction("أﺑﺠﺪ", new ReplacementOptions("[test]"));
red.IsRightToLeft = true;
RedactorChangeLog result = redactor.Apply(red);
if (result.Status != RedactionStatus.Failed)
{
redactor.Save();
};
}
Source*
Fine-Tuned PDF Redaction
Redact specific areas within a PDF document, encompassing text, images, and annotations, based on page range or selection criteria. The code samples below showcase how to redact a selected PDF document area (right half of the last page) using PageAreaRedaction
and redacting a paragraph within your document, respectively.
using (Redactor redactor = new Redactor("Sample.pdf"))
{
Regex rx = new Regex("urna");
ReplacementOptions optionsText = new ReplacementOptions("[redarea]");
optionsText.Filters = new RedactionFilter[] {
new PageRangeFilter(PageSeekOrigin.End, 0, 1), // last page
new PageAreaFilter(new System.Drawing.Point(300, 0), new System.Drawing.Size(300, 840)) // right half of the page 300x840
};
RegionReplacementOptions optionsImg = new RegionReplacementOptions(System.Drawing.Color.Chocolate, new System.Drawing.Size(100, 100));
RedactorChangeLog result = redactor.Apply(new PageAreaRedaction(rx, optionsText, optionsImg));
if (result.Status != RedactionStatus.Failed)
{
redactor.Save();
};
}
Source*
using (Redactor redactor = new Redactor("LoremIpsum.pdf"))
{
RedactorChangeLog result = redactor.Apply(new RegexRedaction("(Lorem(\n|.)+?urna)", new ReplacementOptions(System.Drawing.Color.Red)));
if (result.Status != RedactionStatus.Failed)
{
redactor.Save();
};
}
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting GroupDocs.Redaction for .NET 23.8 Release Notes.