Skip to content

Python code for Py2pdf - Easy Python Code to PDF Converter using enscript, ps2pdf and fpdf

License

Notifications You must be signed in to change notification settings

foiegreis/Py2pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Python code for Py2pdf - Easy Python Code to PDF Converter using enscript, ps2pdf and fpdf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages