Every code example shown on this documentation site is also available in runnable form in the GroupDocs.Signature-for-Python-via-.NET repository on GitHub. Each example comes with its input sample files, so you can clone the repository and run any of them with a single command.
Prerequisites
Before running the examples, make sure you have:
A supported platform and Python version. See System Requirements. Windows, Linux, and macOS (Intel and Apple Silicon) are supported. Linux and macOS need a few system packages. The examples need Python 3.6 or newer.
Git, or download the repository as a ZIP from GitHub.
A license file (optional but recommended). Without one, the library runs in evaluation mode: documents of more than two pages are refused, signed pages carry an evaluation line, and found signatures report masked values, so verification fails. See Licensing for how to obtain a free temporary license.
Get the Code
Clone the repository and navigate into it:
git clone https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET.git
cd GroupDocs.Signature-for-Python-via-.NET
Project Structure
The repository mirrors this documentation tree. Every documentation page maps to a folder under Examples/, and every tabbed code example on a page maps to a .py file inside that folder. Input sample files live next to the script that reads them.
π GroupDocs.Signature-for-Python-via-.NET
βββ README.md
βββ LICENSE
βββ AGENTS.md β extracted from the pip package for AI tools
βββ Dockerfile β runs the whole suite on Linux
βββ .github/workflows/run-examples.yml β CI: runs all examples on every push
βββ Examples
βββ requirements.txt
βββ run_all_examples.py
βββ getting-started
β βββ quick-start-guide
β βββ sign_pdf_with_text_signature.py
β βββ search_document_for_signatures.py
β βββ verify_text_signature.py
β βββ sample.pdf
β βββ signed.pdf
βββ developer-guide
β βββ basic-usage
β βββ electronic-signature-types/ (text, image, barcode, QR code, stamp, digital, form-field, metadata)
β βββ search-for-electronic-signatures-in-document/
β βββ verify-document-for-signatures/
β βββ update-signatures-in-documents/
β βββ delete-signatures-from-documents/
β βββ generate-document-pages-preview/
β βββ generate-signatures-preview/
β βββ signature-use-cases/
βββ use-cases
β βββ sign-password-protected-pdf/
β βββ signing-documents-linux-container-fonts/
βββ licensing
βββ set_license_from_file.py
βββ set_license_from_stream.py
βββ set_metered_license.py
Setup
Create and activate a virtual environment:
Create:
py-mvenv.venv
python3 -m venv .venv
python3 -m venv .venv
Activate:
.venv\Scripts\activate
source .venv/bin/activate
source .venv/bin/activate
Install dependencies from Examples/requirements.txt:
Configure a license (optional). The suite honours the GROUPDOCS_LIC_PATH environment variable. Set it in your shell before running run_all_examples.py:
Learn more about licensing, evaluation limits, and how to obtain a free 30-day temporary license in the Licensing topic.
Run the Examples
Run the Full Suite
From the repository root, run run_all_examples.py. It runs every example in its own process, prints a status line per file, and ends with a pass/fail summary. Without a license, an example that hits an evaluation limit, such as a sample document of more than two pages, prints a note instead of failing.
pyExamples\run_all_examples.py
python3 Examples/run_all_examples.py
python3 Examples/run_all_examples.py
Run a Single Example
Change into the folder that contains the script and run it directly. Input sample files live next to each script, so relative paths resolve correctly.
cd Examples/getting-started/quick-start-guide
python sign_pdf_with_text_signature.py
Examples that sign or change a document write the result into the same folder as the script. Where an example is documented on this site, the result it produces is also linked from an output tab next to the code; click it to download the file.
Run with Docker
The repository includes a Dockerfile based on python:3.13-slim. It installs the system packages the library needs on Linux (ICU, fontconfig, libgdiplus and the Microsoft core fonts) and every Python dependency, then runs the full suite. Use it when you want a clean, reproducible Linux environment without touching your host machine:
Drop the -e and -v flags to run in evaluation mode. On Windows with Git Bash, run export MSYS_NO_PATHCONV=1 first so that the mounted license path is not rewritten.
Continuous Integration
Every push triggers .github/workflows/run-examples.yml, which installs the same system packages and runs the entire example suite on ubuntu-latest with Python 3.13. Fork the repository and open a pull request: the workflow runs for free on GitHub-hosted runners and is a quick way to check local changes in a clean environment.
Troubleshooting
“The type initializer for ‘Gdip’ threw an exception” on Linux or macOS: install libgdiplus (Linux) or mono-libgdiplus (macOS). Stamp signatures, text rendered as an image, barcode, QR code and image signatures with a border or transparency, signatures on PowerPoint and image files, and signature previews need it. See System Requirements.
“Font Times New Roman was not found” or “Font Arial was not found” on Linux: install the Microsoft core fonts (ttf-mscorefonts-installer).
“Couldn’t find a valid ICU package”, with the Python process ending abruptly: install ICU (libicu-dev on Debian and Ubuntu).
“The number of pages cannot exceed 2 in a trial version”, or searches that report an evaluation notice instead of the signature’s text: you are running unlicensed. Set GROUPDOCS_LIC_PATH to a valid license file and re-run. See Licensing.
If you would like to add or improve an example, we encourage you to contribute. All examples in this repository are open source and can be freely used in your own applications. Fork the repository, edit the example, 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.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.