| layout | default |
|---|---|
| title | Home |
| nav_order | 1 |
| description | Document Template Processing Service - A lightweight microservice for processing Word document templates with data injection and PDF conversion. |
| permalink | / |
{: .fs-9 }
A lightweight microservice for processing Word document templates with data injection and PDF conversion. {: .fs-6 .fw-300 }
Get started now{: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } View on GitHub{: .btn .fs-5 .mb-4 .mb-md-0 }
✨ Easy Template Processing: Transform Word documents with dynamic data injection
🔄 Automatic PDF Conversion: Seamless conversion to PDF using Gotenberg
🚀 Fast REST API: Built with FastAPI for high performance
🐳 Docker Ready: Complete containerization with Docker Compose
☸️ Kubernetes Support: Production-ready deployment manifests
- Backend: FastAPI 0.115.6, Python 3.12
- Templating: docxtpl 0.19.0 (Jinja2-based)
- PDF Generation: Gotenberg 8
- Deployment: Docker, Kubernetes
The fastest way to get up and running:
git clone https://github.com/etherisc-services/document-templating-service.git
cd document-templating-service
docker compose up -dYour service will be available at:
- Health Check: http://localhost:8000/
- 📖 Read the Installation Guide for detailed setup options
- 🔧 Check the Usage Guide for service usage and examples
- 🚀 Start building your document templates!
Process a Word template with dynamic data:
curl -X POST \
http://localhost:8000/api/v1/process-template-document \
-F "file=@template.docx" \
-F "data={\"name\":\"John Doe\",\"amount\":150.00}" \
--output result.pdfProcess templates with embedded images:
# Encode image and create request
IMAGE_BASE64=$(base64 -w 0 logo.png)
REQUEST_DATA='{"template_data":{"name":"John Doe","logo":"{{company_logo}}"},"images":{"company_logo":{"data":"'$IMAGE_BASE64'","width_mm":50,"height_mm":20}}}'
curl -X POST \
http://localhost:8000/api/v1/process-template-document-with-images \
-F "file=@template.docx" \
-F "request_data=$REQUEST_DATA" \
--output result.pdf📋 Installation Guide
Complete setup instructions for all environments
🔧 Usage Guide
Service usage with templating examples
🖼️ Image Support Guide
Include inline images in document templates
🐳 Docker Integration Guide
Integrate with existing Docker Compose stacks
This service combines the power of docxtpl for Word document templating with Gotenberg for PDF conversion, providing a simple REST API for document processing workflows.
Etherisc GmbH (Originally created by M.B.C.M (PapiHack))
We welcome contributions! Please feel free to submit a Pull Request. Make sure to include a description with your PR.
This project is licensed under the MIT License - see the LICENSE file for details.