# likha-pdf a simple web app that converts markdown to pdf. likha-pdf screenshot ## features - markdown to pdf export - paper size, margin, font, line spacing, and page number options - syntax-highlighted code blocks - always produces a pdf (reportlab fallback if weasyprint fails) ## requirements - python 3.10+ - system packages: `libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 shared-mime-info` - gunicorn (installed from `requirements.txt`) ## image usage 1. upload an image from the page (stored on the server for your current browser session) 2. click `insert image` to add a `session-image://...` markdown token 3. generate pdf ## run ### local ```bash python -m venv .venv source .venv/bin/activate pip install -r requirements.txt cd src/ python3 app.py ``` ### production (vps + nginx) ```bash cd src/ ../.venv/bin/gunicorn \ --bind 127.0.0.1:5001 \ --worker-class gthread \ --workers 1 \ --threads 2 \ --timeout 240 \ --graceful-timeout 30 \ --keep-alive 5 \ --max-requests 300 \ --max-requests-jitter 50 \ --access-logfile - \ --error-logfile - \ app:app ``` nginx should reverse proxy to `127.0.0.1:5001` and pass: - `X-Forwarded-For` - `X-Forwarded-Proto` - `X-Forwarded-Host`