A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Tommypop2/code-to-pdf below:

Tommypop2/code-to-pdf: Generates a syntax-highlighted PDF of your source code

Converts a folder of source code to a fully syntax-highlighted PDF

cargo install code-to-pdf

Installs a pre-built binary if it is available for your system

cargo binstall code-to-pdf
Using artefacts on Github Releases

Navigate to the latest release

Run the correct installer script for your system, or just download the correct binary directly

Build from repository source
git clone https://github.com/Tommypop2/code-to-pdf
cargo install --path ./code-to-pdf
Generating a PDF from a folder

This walks the current folder and generates a syntax-highlighted PDF of all files in that folder

c2pdf . --exclude pnpm-lock.yaml,*.lock
c2pdf . --out custom_name.pdf

Supports loading fonts from a path or the system fonts

# From a path
c2pdf . --font fonts/Helvetica.ttf

# From system fonts
c2pdf . --font "Arial"
c2pdf . --font-size 12.5 # 12.0 by default
c2pdf . --margin-top 20 --margin-bottom 5 --margin-left 10 --margin-right 10 # (these are the defaults)

This is text that is added to every page

c2pdf . --page-text "Hello\nWorld" # (use `\n` to indicate a newline)

Generated PDFs can be decoded - recreating the original source tree which they were generated from

dc2pdf ./generated_pdf.pdf --out-dir ./generated # Default out-dir is `./generated`

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4