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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 373a66b078057fd2f1c3149ada82617b26651154264ab0ae322474f99d47118e |
|
MD5 | cb5cd89e80d90103a70995b5d86552cc |
|
BLAKE2b-256 | 7abedaec5e174a6a5f8fd0d33f9a18d982580bbbb77da5e960644cfe282a1a60 |
Hashes for document_merge_service-6.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dff07bf92787713eb193cd22a3a8253cdef8354581507c718aa898818c2357ee |
|
MD5 | f5205502de5f2801991839c348f064dd |
|
BLAKE2b-256 | 6f43627c8f99ac607825e4ae77e9338fcab0edbd49c9db0c2696b61c17d3c35c |