Skip to main content

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 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 
haiz-code2pdf -h

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haiz_code2pdf-0.1.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haiz_code2pdf-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file haiz_code2pdf-0.1.1.tar.gz.

File metadata

  • Download URL: haiz_code2pdf-0.1.1.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

Hashes for haiz_code2pdf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f0b4be3b61d96cefd77069727a21c1ce50347fabf9ff4909d5eabf256da26c42
MD5 9fe0dfec0107ef5a13c111a19ef8728f
BLAKE2b-256 74df15c196fe0112e000b55064b148ee3fd8dd059a4650ceb958382459a94e68

See more details on using hashes here.

File details

Details for the file haiz_code2pdf-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: haiz_code2pdf-0.1.1-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

Hashes for haiz_code2pdf-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 536b1d33c919d93ab5c7c24b73c848e3307a3a28dae86a255cd4898cb97bcc40
MD5 0d355e22f67cc99b40b3904fe828e6bd
BLAKE2b-256 a09456067d350885533e290461e67c44e72318c02f1c5540a43e441a92c85e13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page