SaveOptions class
Leave feedback
On this page
Provides options for changing an output file name and/or converting the document to image‑based PDF (rasterization).
Learn more
- Save with default options
- Save in rasterized PDF
- Select specific pages for rasterized PDF
- Save in original format
- Save overwriting original file
- Save to stream
The SaveOptions type exposes the following members:
| 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. |
| 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. |
| Field | Description |
|---|---|
| SAVE_SUFFIX | Represents default suffix value, which is “Redacted”. |
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}")
Task guides that use SaveOptions:
- Hello, World!
- Quick Start Guide
- Redaction basics
- Text redaction
- Image redactions
- Metadata redactions
- Annotation redactions
- Spreadsheet redactions
- Remove page redactions
- Use redaction policies
- OCR usage basics
- Use Tesseract OCR
- Load with file type
- Save Word with OOXML compliance
- module
groupdocs.redaction.options
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.