Docker image: https://hub.docker.com/r/gibbonlab/gibbon-mail
Generate PDF with Template and JSON Schema.
Project status: POC
Screencast: https://www.youtube.com/watch?v=2M10x76f6c8
- I would like to move PDF generation from my application in a separate service
- I would like to allow humans to generate PDF manually, via a simple application plugged to the same API.
- I would like to keep a history (optionally) of all document generated
- Integrate
mozilla-services/react-jsonschema-form
- Integrate
puppeteer
- Docker Image (
harobed/poc-generate-pdf-with-html-template-and-jsonschema:latest
) - curl example
- Screencast
- Add S3 upload option
- Add UISchema support
- Check json input with JSON Schema
- Test frontend
- Configure CI
- Swagger
- Add option to save generated pdf (in PostgreSQL)
gibbonlab/gibbon-pdf
Docker
Image is automatically builded with with our CI. We currently maintain several versions
as we use semver
to tag our docker images
latest
tag is pushed with the last commit onmaster
vX.X.X
tag are pushed when we push a new tag
To see how to create a new tag see "How to publish a new version"
- Generate PDF file from:
- HTML template
- Json field values (validated by JSON Schema)
- Rest API endpoints to generate html preview or PDF
- Web UI to generate PDF manually:
- HTML form are autogenerated by JSON Schema
- User can preview the document or generate the PDF
- Optionnaly record all PDF generation
Inside your pdf templates folders, you can create multiple languages files for the same pdf, in the following format: {lang}.html
.
You also need to let a default file in case the language is not found or no language is requested.
So, for example, your folder should look something like this:
$ ls pdf-templates/pdf-example
default.html de.html fr.html es.html
Then, you can add the lang
property to the body or query params of your request, which will send the pdf with the requested language if it exists.
For example, the following body will try to send a german pdf:
{
...,
"lang": "de"
}
If the lang
property is not present in the body of your request, the default pdf will be sent.
- Backend:
- Frontend
- ReactJS, Axios, React-router
- react-jsonschema-form to generate Form from JSON Schema (need Bootstrap version
v3.3.6
) - Bootstrap
- Tooling
This project hasn't build-in authentication system, it's a internal service in your stack, you must protect it by a private network or Basic access authentication system.
Gibbon as an allusion to Mandrill App.
Invoice examples:
Compare with other projects: