SaveOptions class

SaveOptions class

Provides options for changing an output file name and/or converting the document to image‑based PDF (rasterization).

Learn more

The SaveOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance with default settings: rasterize to PDF is False and add suffix is False.
init Initializes a new SaveOptions instance with given parameters.

Properties

Property Description
add_suffix The file name will be changed before saving when set to True. False by default.
rasterization The rasterization settings.
rasterize_to_pdf The rasterize_to_pdf property indicates whether all pages in the document are converted to images and placed in a single PDF file.
redacted_file_suffix The custom suffix for the output file name. If not specified, the SaveOptions.save_suffix constant is used.
wordprocessing_save_options The save options specific to word processing documents.

Fields

Field Description
SAVE_SUFFIX Represents default suffix value, which is “Redacted”.

Example

from groupdocs.redaction import Redactor
from groupdocs.redaction.options import SaveOptions
from groupdocs.redaction.redactions import ExactPhraseRedaction, ReplacementOptions

with Redactor("./sample.docx") as redactor:
    redactor.apply(ExactPhraseRedaction("Emily Johnson", ReplacementOptions("[personal]")))
    options = SaveOptions()
    options.add_suffix = True
    options.rasterize_to_pdf = True
    options.redacted_file_suffix = "redacted"
    result_path = redactor.save(options)
    print(f"Document saved to {result_path}")

Guides

Task guides that use SaveOptions:

See Also