Initializes a new instance with default settings: rasterize_to_pdf is False and add_suffix is False.
def__init__(self):...
Example
fromgroupdocs.redactionimportRedactorfromgroupdocs.redaction.optionsimportSaveOptionsfromgroupdocs.redaction.redactionsimportExactPhraseRedaction,ReplacementOptionsrepl_opt=ReplacementOptions("[personal]")ex_red=ExactPhraseRedaction("John Doe",repl_opt)withRedactor("./sample.docx")asredactor:redactor.apply(ex_red)save_options=SaveOptions()# defaults: rasterize_to_pdf=False, add_suffix=Falseresult_path=redactor.save(save_options)print(f"Document redacted successfully.\nCheck output in {result_path}.")
init
Initializes a new instance with given parameters.
def__init__(self,rasterize_to_pdf,suffix):...
Parameter
Type
Description
rasterize_to_pdf
bool
True, if all pages in the document need to be converted to images and put in a single PDF file.
suffix
str
This text will be added to the end of the file name; if not empty also sets add_suffix to True.
Example
fromgroupdocs.redaction.optionsimportSaveOptions# Create save options with default settingsoptions=SaveOptions()options.add_suffix=Trueoptions.rasterize_to_pdf=Trueoptions.redacted_file_suffix="redacted"