/json-forms-pdf

Convert jsonforms.io to PDF

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

json-forms-pdf

Convert jsonforms.io to PDF

Run with

pip install poetry
poetry run pytest

How does it work?

This project aims at describing forms via jsonforms.io using ui-schema and schema so that forms data can be easily reused via API (eg. openapi). General schemas (eg. person, location, ..) is provided via definitions.yaml based on the ongoing work on github.com/teamdigitale/openapi, so you don't have to redefine schemas.

NB: currently jsonforms doesn't support yaml and remote $ref's, but this project does the bundling and conversion for you.

To support legacy processes based on pdf files, this project provides:

  • a static html serializer generating an HTML from the ui-schema
  • an html to pdf converter based on the docker image of wkhtmltopdf

An example output is in examples

Notes

The current setup uses python to generate a simple HTML form from the ui-schema.

Then wkhtmltopdf with form support available on docker hub to convert the HTML to PDF.

docker run --rm -v $(pwd):/data madnight/docker-alpine-wkhtmltopdf /data/test.html /data/test.pdf