Skip to content

Latest commit

 

History

History
128 lines (85 loc) · 3.6 KB

File metadata and controls

128 lines (85 loc) · 3.6 KB
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 /

Document Template Processing Service

{: .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 }


Features

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

Technology Stack

  • Backend: FastAPI 0.115.6, Python 3.12
  • Templating: docxtpl 0.19.0 (Jinja2-based)
  • PDF Generation: Gotenberg 8
  • Deployment: Docker, Kubernetes

Getting Started

Quick Start with Docker Compose

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 -d

Your service will be available at:

Next Steps

  1. 📖 Read the Installation Guide for detailed setup options
  2. 🔧 Check the Usage Guide for service usage and examples
  3. 🚀 Start building your document templates!

API Examples

Basic Template Processing

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.pdf

Template Processing with Images

Process 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

Documentation

📋 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


About

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.

Original Author

Etherisc GmbH (Originally created by M.B.C.M (PapiHack))


Contributing

We welcome contributions! Please feel free to submit a Pull Request. Make sure to include a description with your PR.

License

This project is licensed under the MIT License - see the LICENSE file for details.