Before running an example make sure that GroupDocs.Redaction for Python via .NET has been installed successfully.
The complete examples project for GroupDocs.Redaction for Python via .NET is hosted on GitHub. It contains standalone, runnable scripts together with the sample documents they use, so the examples work out of the box.
To run the examples without evaluation limitations, point the GROUPDOCS_LIC_PATH environment variable at your license file. The example scripts read this variable and apply the license automatically:
The repository ships with all the sample documents and resources used by the examples, so the scripts run out of the box.
Note
Without a license the examples run in evaluation mode, which raises a TrialLimitationsException if more than one document is opened in the same process. The run_all_examples.py runner launches each example in its own process so they all complete even unlicensed, but redaction output is limited (one redaction per document, up to four replacements, and trial badges on each page).
Run with Docker
The repository includes a Dockerfile that installs the native dependencies and Python packages so you can run the examples in a clean, reproducible container. From the repository root:
docker build -t groupdocs-redaction-examples .
docker run --rm groupdocs-redaction-examples
To use a license inside the container, mount it and pass GROUPDOCS_LIC_PATH:
Because the examples run headlessly and exit with a non-zero status on failure, they fit naturally into a CI pipeline. Install Examples/requirements.txt, supply the license through the GROUPDOCS_LIC_PATH environment variable (store the license as a protected secret), make sure the Linux native dependencies are present on the runner, and invoke python Examples/run_all_examples.py as a build step. The provided Dockerfile is a convenient base image for such jobs.
Troubleshooting
"…rasterization / image-export step is not supported on this platform" on Linux/macOS — expected on non-Windows in 26.6.0. The rasterized-PDF and image-redaction paths use System.Drawing.Common, which the bundled runtime supports only on Windows, so they raise System.PlatformNotSupportedException. The run_all_examples.py runner catches this and logs the note so the suite still completes; the example’s text/metadata/annotation steps still run. To exercise rasterization and image redaction, run on Windows, or save in the original format with SaveOptions(rasterize_to_pdf=False). See System Requirements for the full platform-support matrix. Installing libgdiplus does not remove this restriction.
Missing or substituted fonts — install fonts so rasterized output (on Windows) matches the original: apt install libfontconfig1 ttf-mscorefonts-installer.
ICU / globalization errors on Linux — install ICU: apt install libicu-dev.
TrialLimitationsException — you are running unlicensed in evaluation mode, which permits only one document open per process, one redaction, and up to four replacements. Set GROUPDOCS_LIC_PATH to a valid license to remove these limits.
Contribute
If you would like to add or improve an example, we encourage you to contribute to the project. All examples in this repository are open source and can be freely used in your own applications. To contribute, fork the repository, edit the code, and create a pull request. We will review the changes and include them if found helpful.
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.