Giter Club home page Giter Club logo

document-merge-service's Introduction

Document Merge Service

Build Status Black License: GPL-3.0-or-later

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 [email protected] --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 [email protected] --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.

document-merge-service's People

Contributors

open-dynamix avatar dependabot-preview[bot] avatar winged avatar anehx avatar pyup-bot avatar winpat avatar sliverc avatar czosel avatar dependabot[bot] avatar yelinz avatar stephanh90 avatar trowik avatar fkm-adfinis avatar fkm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.