Yehor's picture
Update README.md
25406ff verified
metadata
title: Typst-based PDF generation
emoji: πŸ“„
colorFrom: green
colorTo: indigo
sdk: docker
pinned: false
short_description: Use a modern document-generator to render PDF files

Generate PDF documents using Gradio and Typst

  • minijinja to template a Typst document
  • Typst to generate a PDF document
  • Gradio to provide a web interface with user parameters (via Components)
  • Docker to run the app

Demo

Install

Clone the repository:

git clone https://github.com/egorsmkv/pdf-generator-gradio
cd pdf-generator-gradio

Install typst:

cargo install typst-cli

Development

Create virtual environment and install dependencies:

uv venv --python 3.13

source .venv/bin/activate

uv pip install -r requirements.txt
uv pip install -r requirements-dev.txt

Run

Run Gradio app locally:

export TYPST_BIN=/home/yehor/.cargo/bin/typst

gradio app.py

Production

Build the Docker image:

docker build -t pdf-generator-gradio .

Run:

docker run --rm -p 7860:7860 -it pdf-generator-gradio

# Enable Gradio sharing
docker run --rm -p 7860:7860 -e DO_SHARE=y -it pdf-generator-gradio