Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Created September 19, 2023 08:58
Show Gist options
  • Save conholdate-gists/7c42a1864e2e2c4fc632fad99961a36a to your computer and use it in GitHub Desktop.
Save conholdate-gists/7c42a1864e2e2c4fc632fad99961a36a to your computer and use it in GitHub Desktop.
Redact PDF Online for Free | PDF Text Image Metadata Redaction Online
// Create redactor
Redactor redactor = new Redactor("sample.pdf");
// Create exact phrase redaction
ExactPhraseRedaction redaction = new ExactPhraseRedaction("John Doe", true, new ReplacementOptions("[personal]"));
// Apply redaction
RedactorChangeLog result = redactor.Apply(redaction);
if (result.Status != RedactionStatus.Failed)
{
redactor.Save();
};
// Create redactor
final Redactor redactor = new Redactor("sample.pdf");
try
{
// Create exact phrase redaction and apply redaction
redactor.apply(new ExactPhraseRedaction("John Doe", true /*isCaseSensitive*/, new ReplacementOptions("[personal]")));
redactor.save();
}
finally { redactor.close(); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment