Render source code files as landscape PDFs laid out as book spreads.
Project description
haiz-code2pdf
Render source code files into landscape PDFs formatted as book spreads — featuring two columns per page, line-number gutters, and a central spine line.
Perfect for printing readable code, preparing physical code reviews, or generating clean PDF documentation.
Features
- Book-Spread Layout: Automatically formats code into two landscape columns per page separated by a spine gutter.
- Syntax Highlighting: Uses Pygments for full language support (defaults to high-contrast black-and-white
bwstyle optimized for printing). - Interactive REPL Mode (
--repl): Interactive file and directory picker to quickly batch-convert or merge multiple files into a single PDF. - Git-Aware: Respects
.gitignorerules automatically when picking files. - Smart Re-Indentation: Automatically detects existing code indentation (2, 3, 4 spaces) and re-indents to your desired tab stop.
- Automatic Line Wrapping: Wraps long code lines gracefully without breaking token formatting.
Installation
From PyPI
pip install haiz-code2pdf
# For help
code-to-pdf -h
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 haiz_code2pdf-0.1.2.tar.gz.
File metadata
- Download URL: haiz_code2pdf-0.1.2.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb2d86679d15c1704f86beebbdbc6ea806f968ce5f5f3ad1a3c5ce36a7ea3e48
|
|
| MD5 |
f54bd3211b4cc6d5fb81bfa777505892
|
|
| BLAKE2b-256 |
33463caee450b8fb12f533027e4a17864fd3d267129f675d48bb467a76f532a4
|
File details
Details for the file haiz_code2pdf-0.1.2-py3-none-any.whl.
File metadata
- Download URL: haiz_code2pdf-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1ad98f52cb79d83802a6e050b7398bf41a8a23ce868e6b7375ce04032b32474
|
|
| MD5 |
3a62b44272cc87d5b33634b07ad8c402
|
|
| BLAKE2b-256 |
6b0bc1c35c9f2352469df253b84bb0d8b42ba2f083e9272c90bfd17fc04098c1
|