Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 1.45 KB

README.md

File metadata and controls

48 lines (31 loc) · 1.45 KB

Py2Pdf: Python Code to PDF Converter

This Python script converts Python code (.py files) to PDF files with syntax highlighting using enscript and ps2pdf. It displays an easy to use GUI implemented using customtkinter

gui interface

The pdf options you can specify are:

  • the page orientation (portrait or landscape)
  • the font name and size
  • the code color palette: b/w or color

Please refer to https://linux.die.net/man/1/enscript for the complete list of esnscript arguments

Prerequisites

Installation

Make sure you have enscript and ps2pdf installed on your system. Install the required Python libraries by running:

pip3 install fpdf
pip3 install customtkinter

Usage

git clone https://github.com/foiegreis/Py2pdf.git

cd Py2pdf

Run

python3 py2pdf.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

The script uses the fpdf library for PDF generation.

Syntax highlighting is performed using the enscript library.