SVG Jinja templates + YAML config = PDF documents
Project description
pdfbaker
Create PDF documents from YAML-configured SVG templates.
Quickstart
Installation
pdfbaker is available on PyPI and can be installed using pipx:
pipx install pdfbaker
If you don't have pipx yet, install it first:
sudo apt install pipx
pipx ensurepath
Optional Dependencies
-
For SVG to PDF conversion, CairoSVG is used by default. If you need Inkscape instead, install it:
sudo apt install inkscape
-
For PDF compression, install Ghostscript:
sudo apt install ghostscript
-
If your templates embed particular fonts, they need to be installed. For example for Roboto fonts:
sudo apt install fonts-roboto
Basic Usage
- Create your document design in an SVG editor
- Replace text with variables using Jinja2 (e.g.,
{{ title }}) - Configure your content in YAML
- Generate PDFs with:
pdfbaker bake <config_file>
This will produce your PDF files in a dist/ directory where your configuration file
lives. It will also create a build/ directory with intermediate files, which is only
kept if you specify --keep-build-files (or --debug).
Examples
For working examples, see the examples directory:
- minimal - Basic usage
- regular - Standard features
- variants - Document variants
- custom_locations - Custom file/directory locations
- custom_processing - Custom processing with Python
Create all PDFs with:
pdfbaker bake examples/examples.yaml
Documentation
( on GitHub )
Development
All source code is on GitHub.
This project uses uv for dependency management. The
uv.lock file ensures reproducible builds.
Create and activate the virtual environment:
uv venv
source .venv/bin/activate
Install development dependencies:
uv sync --dev
Tests
Run tests:
pytest
View test coverage:
pytest --cov=pdfbaker --cov-report=term-missing
Pre-commit hook
If you want to commit changes, install pre-commit and run
pre-commit install
This ensures the same checks run locally as in GitHub CI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdfbaker-0.8.2.tar.gz.
File metadata
- Download URL: pdfbaker-0.8.2.tar.gz
- Upload date:
- Size: 145.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c89c16eec6c6310b0a01f942e2693b96636f57e6eb5c8fc14a1dada4f1497ad
|
|
| MD5 |
7e44e7676f6b0333686a772e54108e81
|
|
| BLAKE2b-256 |
0e36eedeacc2ebef49321eba0b00395f80941deca586c3fe5a0204af6e4c0aad
|
Provenance
The following attestation bundles were made for pdfbaker-0.8.2.tar.gz:
Publisher:
semantic-release.yaml on pythonnz/pdfbaker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdfbaker-0.8.2.tar.gz -
Subject digest:
2c89c16eec6c6310b0a01f942e2693b96636f57e6eb5c8fc14a1dada4f1497ad - Sigstore transparency entry: 208511126
- Sigstore integration time:
-
Permalink:
pythonnz/pdfbaker@2deb5da71207f0fef118e3e83339641123844d69 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pythonnz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
semantic-release.yaml@2deb5da71207f0fef118e3e83339641123844d69 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pdfbaker-0.8.2-py3-none-any.whl.
File metadata
- Download URL: pdfbaker-0.8.2-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d14c404b528112b9fb0c27b7ff3d78c5c86ad458e733b1ac513bbf4fab4955ce
|
|
| MD5 |
6d80e00582eafe9a92be8b31a8ad56ba
|
|
| BLAKE2b-256 |
c3f618fad23809bc2337fb298ec3d67468f92796cf5f0d7866c0d8ac134a1a25
|
Provenance
The following attestation bundles were made for pdfbaker-0.8.2-py3-none-any.whl:
Publisher:
semantic-release.yaml on pythonnz/pdfbaker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdfbaker-0.8.2-py3-none-any.whl -
Subject digest:
d14c404b528112b9fb0c27b7ff3d78c5c86ad458e733b1ac513bbf4fab4955ce - Sigstore transparency entry: 208511127
- Sigstore integration time:
-
Permalink:
pythonnz/pdfbaker@2deb5da71207f0fef118e3e83339641123844d69 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pythonnz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
semantic-release.yaml@2deb5da71207f0fef118e3e83339641123844d69 -
Trigger Event:
push
-
Statement type: