RectangleProps defines properties of the redaction rectangle to be drawn.
type RectangleProps struct { FillColor creator.Color // fill color of the rectangle. BorderWidth float64 // a floating number that determines the border width. FillOpacity float64 // a floating number that determines the opacity of the rectangle as a fraction of 1. }
func RedactRectanglePropsNew() *RectangleProps
RedactRectanglePropsNew return a new pointer to a default RectangleProps object.
RedactionOptions is a collection of RedactionTerm objects.
type RedactionOptions struct { Terms []RedactionTerm }
RedactionTerm holds the regexp pattern and the replacement string for the redaction process.
type RedactionTerm struct { Pattern *regexp.Regexp }
Redactor represents a Redactor object.
type Redactor struct {
// contains filtered or unexported fields
}
func New(reader *model.PdfReader, opts *RedactionOptions, rectProps *RectangleProps) *Redactor
New instantiates a Redactor object with given PdfReader and `regex` pattern.
func (re *Redactor) Redact() error
Redact executes the redact operation on a pdf file and updates the content streams of all pages of the file.
func (re *Redactor) Write(writer io.Writer) error
Write writes the content of `re.creator` to writer of type io.Writer interface.
func (re *Redactor) WriteToFile(outputPath string) error
WriteToFile writes the redacted document to file specified by `outputPath`.