https://github.com/endalk200/render_pdf
Source code to PDF renderer. Renders PDF files from source code with syntax highlighting, Can be used for teaching and assignment purposes.
https://github.com/endalk200/render_pdf
pdf render render-pdf source-code-rendering
Last synced: 10 months ago
JSON representation
Source code to PDF renderer. Renders PDF files from source code with syntax highlighting, Can be used for teaching and assignment purposes.
- Host: GitHub
- URL: https://github.com/endalk200/render_pdf
- Owner: endalk200
- License: mit
- Created: 2020-08-31T10:48:09.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-08T00:45:24.000Z (over 3 years ago)
- Last Synced: 2025-07-24T23:34:14.224Z (10 months ago)
- Topics: pdf, render, render-pdf, source-code-rendering
- Language: Python
- Homepage:
- Size: 351 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Render PDF
render_pdf is python script based on weasyprint that converts any source code to pdf file.
## Showcase
> Single Code Base

> Two Source Codes Side By Side

## 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
```bash
pip install render_pdf
```
> For windows
```bash
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
```bash
render ./example/render.py -o ./example/render.pdf
```
* rendering multiple source codes from local directory
```bash
render ./setup.py ./example/render.py -o ./example/render.pdf
```
### rendering two source codes side by side for comparison.
```bash
render -y ./setup.py ./example/render.py -o ./example/render.pdf
```
### rendering source code by downloading from the internet.
To render the [setup.py](https://raw.githubusercontent.com/endalk200/render_pdf/main/setup.py) file
from this repository by downloading it from github server.
P
```bash
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.
```bash
git clone https://github.com/endalk200/render_pdf.git
```