The example explains how a text is redacted from the a pdf file using the redactor
package.
To redact a given content from a pdf file:
- First prepare the regular expressions that can match the target texts.
- Then build
redactor.RedactionTerm
using theregex
as shown in the example. - Finaly initialize a
redactor.Redactor
object usingmodel.PdfReader
,redactor.RedactionOptions
andredactor.RectangleProps
to apply redaction on the given pdf file.
- redact_text.go The example shows redaction of credit card numbers and emails from a pdf file using regex patterns.