Skip to main content

This is render_pdf, with which you can render source code as PDFs.

Project description

Render PDF

render_pdf is python script based on weasyprint that converts any source code to pdf file.

Showcase

Single Code Base Rendered source code

Two Source Codes Side By Side Side By Side Rendered Source Code

Features

This script has the following features.

  • syntax highlighting for any source code using pygments.
  • line number for the source code.
  • rendering any online materials or source code by downloading it.

Installation

You can install this package from the pypi index using the following commands.

For Linux Based OS

pip install render_pdf

For windows

python -m pip install render_pdf

Usage

This script can be used in variety of ways. The following examples and the results are stored in the example directory in this repository.

  • rendering single source code from local directory
render ./example/render.py -o ./example/render.pdf
  • rendering multiple source codes from local directory
render ./setup.py ./example/render.py -o ./example/render.pdf

rendering two source codes side by side for comparison.

render -y ./setup.py ./example/render.py -o ./example/render.pdf

rendering source code by downloading from the internet.

To render the setup.py file from this repository by downloading it from github server. P

render https://raw.githubusercontent.com/endalk200/render_pdf/main/setup.py -o setup.pdf

Source Code

You can see the source code by cloning the repository as follows.

git clone https://github.com/endalk200/render_pdf.git

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

render_pdf-0.2.2.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

render_pdf-0.2.2-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

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