PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
ComPDF Generation is a self-hosted HTML template management and PDF generation service. It provides a web interface and HTTP API for managing HTML templates, optional JSON data sources, and PDF output generated by the ComPDF PDF Generation engine.
Use ComPDF Generation when you need to keep templates and document-generation workflows within your own environment.
────────────────────────────────────
Browser / API Client
http://localhost:${APP_PORT}
────────────────────────────────────
│ HTML / CSS / JS
│ HTTP /api/*
▼
────────────────────────────────────
compdf-generation container
Vue 3 static files + Express API
port 8090
────────────────────────────────────
- Express serves frontend static assets and falls back to `index.html` for SPA routes.
- `/api/templates/*` manages template HTML, JSON data sources, and metadata.
- `/api/v1/process/pdf/generation/template-to-pdf` proxies PDF generation requests.
- Handles uploads, timeouts, error responses, download filenames, and trace IDs consistently.
────────────────────────────────────
│ HTTP
│ compdf-internal
▼
────────────────────────────────────
compdf-app container
ComPDF PDF Generation engine
port 7001
────────────────────────────────────compdf-generation and calls Express through same-origin /api, so production deployments do not require a separate static file server./data/templates. This directory is bound to TEMPLATE_STORAGE_DIR on the host, so data remains after the container is rebuilt.http://compdf-app:7001/v1/sync/generation/template-to-pdf. It prepares multipart requests, passes through PDF responses, and standardizes error messages and traceId values.compdf-generation starts after the compdf-app health check passes. The two services communicate through the private compdf-internal bridge network.dist, backend dist, and production dependencies into the final non-root Node.js container. Version 1.1.0 optimizes the underlying image by removing the unnecessary database dependency and reducing image size.APP_PORT (default 8090) to the web/API container. It also publishes the engine's 7001 port to the host for local backend development and connectivity checks./api to http://localhost:8090. Express accesses the ComPDF engine in Docker through http://localhost:7001 by default.| Layer | Framework or Component | Purpose |
|---|---|---|
| Frontend | Vue 3, Vue Router, Vue I18n | Single-page interface, routing, and six-language internationalization. |
| Frontend build | Vite, TypeScript, Less | Development server, type checking, and style builds. |
| Frontend UI | TDesign Vue Next, tdesign-icons-vue-next | UI components and icons. |
| Template editing | WangEditor (@wangeditor/editor-for-vue) | HTML rich-text template editing. |
| HTTP client | Axios | Calls same-origin /api endpoints and handles file downloads. |
| Backend | Node.js 22, Express, TypeScript | Provides the HTTP API, static files, and ComPDF proxy. |
| Upload and archiving | Multer, Archiver | Handles multipart file uploads and template ZIP downloads. |
| PDF generation | compdfkit/pdf-generation:1.1.0 | Performs synchronous HTML/template-to-PDF generation. |
| Deployment | Docker Compose, multi-stage Docker builds | Orchestrates the ComPDF engine and web/API container. |
| Data persistence | Host filesystem | Persists template HTML, JSON, and metadata. |