Skip to main content

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 bw style 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 .gitignore rules 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

Release files for haiz-code2pdf 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haiz-code2pdf 0.1.2
File Size Uploaded
haiz_code2pdf-0.1.2.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for haiz-code2pdf 0.1.2
File Interpreter ABI Platform
haiz_code2pdf-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 kB

Release files / haiz_code2pdf-0.1.2.tar.gz

Download URL haiz_code2pdf-0.1.2.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bb2d86679d15c1704f86beebbdbc6ea806f968ce5f5f3ad1a3c5ce36a7ea3e48
BLAKE2b-256 checksum
How to use checksums
33463caee450b8fb12f533027e4a17864fd3d267129f675d48bb467a76f532a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / haiz_code2pdf-0.1.2-py3-none-any.whl

Download URL haiz_code2pdf-0.1.2-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1ad98f52cb79d83802a6e050b7398bf41a8a23ce868e6b7375ce04032b32474
BLAKE2b-256 checksum
How to use checksums
6b0bc1c35c9f2352469df253b84bb0d8b42ba2f083e9272c90bfd17fc04098c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page