Merge Document Template Service
Project description
Document Merge Service
A document template merge service providing an API to manage templates and merge them with given data. It can also be used to convert Docx files to PDF.
Installation
Requirements
- docker
- docker-compose
After installing and configuring those, download docker-compose.yml and run the following command:
docker-compose up -d
You can now access the api at http://localhost:8000/api/v1/ which includes a browsable api.
Workaround LibreOffice lockup
The workaround has a setting called ISOLATE_UNOCONV
, it is only enabled in the
development environment. If ISOLATE_UNOCONV
is enabled the container needs
CAP_SYS_ADMIN
. See docker-compose.override.yml.
cap_add:
- CAP_SYS_ADMIN
security_opt:
- apparmor:unconfined
environment:
- ISOLATE_UNOCONV=true
Getting started
Uploading templates
Upload templates using the following:
curl --form template=@docx-template.docx --form name="Test Template" --form engine=docx-template http://localhost:8000/api/v1/template/
Merging a template
After uploading successfully, you can merge a template with the following call:
curl -H "Content-Type: application/json" --data '{"data": {"test": "Test Input"}}' http://localhost:8000/api/v1/template/test-template/merge/ > output.docx
Converting a template
To convert a standalone Docx file the following call can be used:
curl -X POST --form file=@my-test-file.docx --form target_format="pdf" http://localhost:8000/api/v1/convert > example.pdf
Further reading
- Configuration - Further configuration and how to do a production setup
- Usage - How to use the DMS and it's features
- Contributing - Look here to see how to start with your first contribution. Contributions are welcome!
License
Code released under the GPL-3.0-or-later license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for document_merge_service-6.6.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d00c600847c04c3106478d3e1e1c768258ebf25ff9c9359131fe7675591ecaf |
|
MD5 | e58eac9711e085890b8170571c37bed8 |
|
BLAKE2b-256 | 2c1970082c44513ec3b8c7f21d5e6022ca58e0680729fce40d84753a17ec7c35 |
Hashes for document_merge_service-6.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecdab1bc3f0109e9b9d35c0d659df8895b65b9f373b62addfb9cfc45e07c2513 |
|
MD5 | e014f8b51de52f0f5df8307e0a06c06c |
|
BLAKE2b-256 | 617846a6b3f20cbdbd15b7efbbf35dd4310362517ed995a7da718a219d6e9874 |