A high-performance Rust-based service for converting LaTeX and HTML documents to PDF files.
Nyomda is a lightweight, containerized PDF generation service that provides a simple API for converting markup documents (LaTeX and HTML) into professionally formatted PDF files. Built with Rust for maximum performance and reliability, Nyomda is designed to be easily deployed via Docker.
- LaTeX to PDF Conversion: Full support for LaTeX documents with complex mathematical equations, tables, and formatting
- HTML to PDF Conversion: Convert HTML documents to PDF while preserving styling and layout
- Docker Ready: Pre-built Docker image for easy deployment
- High Performance: Written in Rust for speed and memory efficiency
- REST API: Simple HTTP interface for document conversion
- Lightweight: Minimal resource footprint
- Docker (for containerized deployment)
- OR Rust 1.70+ (for building from source)
The easiest way to run Nyomda is using the Docker image:
# Pull the latest image
docker pull ghcr.io/whizzes/nyomda:<VERSION>
# Run the service
docker run -p 8080:8080 ghcr.io/whizzes/nyomda:<VERSION>The service will be available at http://localhost:9000
- Rust 1.70 or higher
- Cargo (comes with Rust)
- LaTeX distribution (e.g., TeX Live, MiKTeX)
- wkhtmltopdf (for HTML conversion)
- Chrome or Chromium (for HTML rendering)
# Clone the repository
git clone https://github.com/whizzes/nyomda.git
cd nyomda
# Build the project
cargo build --release
# Run the service
cargo run --releasecurl -X POST http://localhost:9000/api/v0/compile \
-H "Content-Type: application/json" \
-d '{
"text": "\\documentclass{article}\n\\begin{document}\nHello World!\n\\end{document}"
}' \
--output output.pdfcurl -X POST http://localhost:9000/api/v0/print \
-H "Content-Type: application/json" \
-d '{
"html": "<html><body><h1>Hello World!</h1></body></html>"
}' \
--output output.pdfdocker run -p 9000:9000 ghcr.io/whizzes/nyomda:<VERSION>Create a docker-compose.yml file:
version: '3.8'
services:
nyomda:
image: ghcr.io/whizzes/nyomda:<VERSION>
ports:
- "9000:9000"
restart: unless-stopped\documentclass{article}
\begin{document}
\title{Sample Document}
\author{Your Name}
\date{\today}
\maketitle
\section{Introduction}
This is a sample document.
\end{document}\documentclass{article}
\usepackage{amsmath}
\begin{document}
\section{Mathematical Equations}
The quadratic formula is:
$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$
\end{document}<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; }
h1 { color: #333; }
</style>
</head>
<body>
<h1>Sample Report</h1>
<p>This is a sample HTML document converted to PDF.</p>
</body>
</html><!DOCTYPE html>
<html>
<head>
<style>
.header { background-color: #4CAF50; color: white; padding: 20px; }
.content { padding: 20px; }
table { border-collapse: collapse; width: 100%; }
td, th { border: 1px solid #ddd; padding: 8px; }
</style>
</head>
<body>
<div class="header">
<h1>Monthly Report</h1>
</div>
<div class="content">
<table>
<tr><th>Item</th><th>Value</th></tr>
<tr><td>Revenue</td><td>$10,000</td></tr>
</table>
</div>
</body>
</html>- Built with Rust
- LaTeX conversion powered by TeX Live
- HTML conversion using wkhtmltopdf
- Containerization with Docker
- Support for additional input formats (Markdown, AsciiDoc)
- Batch conversion API
- Template system for common document types
- S3/cloud storage integration
- Webhook notifications for async processing
- PDF metadata customization
- Digital signature support