Sign inSign up

haanlaurent/sourceprinter

By haanlaurent

•Updated 2 days ago

Source code PDF generator for student projects

Image
0

775

haanlaurent/sourceprinter repository overview

⁠Source Printer

Source Printer turns a zip full of student coding projects into syntax-highlighted PDFs.

It parses source files from uploaded project archives, renders them with configurable formatting, and returns either a single merged PDF or a zip of per-project PDFs.

⁠Run with Docker

docker run --rm -p 8080:8080 haanlaurent/sourceprinter:latest

Then open:

http://localhost:8080

Run a specific version tag:

docker run --rm -p 8080:8080 haanlaurent/sourceprinter:v0.9.4

⁠Environment Variables

VariableDefaultDescription
PORT8080Port the server listens on
RENDER_CONCURRENCY2Number of files rendered in parallel within a single job
MAX_ACTIVE_JOBS2Maximum number of render jobs running simultaneously
MAX_QUEUED_JOBS8Maximum number of jobs waiting in the queue before returning HTTP 429
MAX_ZIP_BYTES52428800Maximum upload size for the zip file (bytes)
MAX_TOTAL_BYTES52428800Maximum total size of all extracted source files combined (bytes)
MAX_UMZ_BYTES10485760Maximum uncompressed size of embedded UMZ archives (bytes)
MAX_FILE_BYTES2097152Maximum size of a single source file (bytes)
MAX_FILE_COUNT2000Maximum number of source files allowed in a zip
CHROMIUM_NO_SANDBOX1Set to 0 only if running with a seccomp profile that supports Chromium sandboxing

Example with custom limits:

docker run --rm -p 8080:8080 \
  -e RENDER_CONCURRENCY=4 \
  -e MAX_ACTIVE_JOBS=4 \
  -e MAX_ZIP_BYTES=104857600 \
  haanlaurent/sourceprinter:latest

⁠Features

  • Upload a zip containing multiple student/project folders
  • Supports many programming language extensions
  • Syntax highlighting via highlight.js
  • Configurable font, font size, line height, color theme, headers, and page numbers
  • Optional filters such as removing comments, collapsing blank lines, and converting tabs to spaces
  • Output as one PDF or per-project PDFs inside a zip
  • Includes Playwright and Chromium for server-side PDF rendering
  • Stateless backend: uploaded files are processed temporarily and deleted after rendering

⁠Source

GitHub repository:

https://github.com/haan/sourceprinter⁠

Tag summary

Content type

Image

Digest

sha256:e0db0692b…

Size

329.9 MB

Last updated

2 days ago

docker pull haanlaurent/sourceprinter