{"id":21997555,"url":"https://github.com/stephane-klein/gibbon-pdf","last_synced_at":"2025-04-30T21:05:16.447Z","repository":{"id":35170466,"uuid":"200800638","full_name":"stephane-klein/gibbon-pdf","owner":"stephane-klein","description":"Generate PDF with Template and JSON Schema","archived":false,"fork":false,"pushed_at":"2023-07-13T03:12:55.000Z","size":2036,"stargazers_count":9,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T21:05:01.362Z","etag":null,"topics":["api","form","json-schema","pdf-generation","puppeteer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephane-klein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-06T07:34:42.000Z","updated_at":"2023-04-05T08:16:08.000Z","dependencies_parsed_at":"2023-01-15T15:11:27.305Z","dependency_job_id":null,"html_url":"https://github.com/stephane-klein/gibbon-pdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fgibbon-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fgibbon-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fgibbon-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fgibbon-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephane-klein","download_url":"https://codeload.github.com/stephane-klein/gibbon-pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251782760,"owners_count":21642986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","form","json-schema","pdf-generation","puppeteer"],"created_at":"2024-11-29T22:16:59.469Z","updated_at":"2025-04-30T21:05:16.392Z","avatar_url":"https://github.com/stephane-klein.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gibbon-pdf\n\nDocker image: https://hub.docker.com/r/spacefill/gibbon-mail\n\nGenerate PDF with Template and JSON Schema.\n\nProject status: [POC](https://en.wikipedia.org/wiki/Proof_of_concept)\n\nScreencast: https://www.youtube.com/watch?v=2M10x76f6c8\n\n## Requirement:\n\n- [nodejs](https://nodejs.org) `14.16.X`\n- [Docker](https://www.docker.com/)\n\n## Why this project?\n\n- I would like to move PDF generation from my application in a separate service\n- I would like to allow humans to generate PDF manually, via a simple application plugged to the same API.\n- I would like to keep a history (optionally) of all document generated\n\n## Roadmaps\n\n- [x] Integrate [`mozilla-services/react-jsonschema-form`](https://github.com/mozilla-services/react-jsonschema-form)\n- [x] Integrate [`puppeteer`](https://github.com/GoogleChrome/puppeteer/)\n- [x] Docker Image (`harobed/poc-generate-pdf-with-html-template-and-jsonschema:latest`)\n- [x] curl example\n- [x] Screencast\n- [ ] Add S3 upload option\n- [ ] Add [UISchema](https://react-jsonschema-form.readthedocs.io/en/latest/) support\n- [ ] Check json input with JSON Schema\n- [ ] Test frontend\n- [X] Configure CI\n- [ ] Swagger\n- [ ] Add option to save generated pdf (in PostgreSQL)\n\n## Docker Image\n\n[`spacefill/gibbon-pdf`](https://hub.docker.com/r/spacefill/gibbon-pdf) Docker\nImage is automatically builded with with our CI. We currently maintain several versions\nas we use [`semver`](https://semver.org/) to tag our docker images\n\n- `latest` tag is pushed with the last commit on `master`\n- `vX.X.X` tag are pushed when we push a new tag\n\nTo see how to create a new tag see [\"How to publish a new version\"](/README.md#how-to-publish-a-new-version)\n\n## Features\n\n- Generate PDF file from:\n  - HTML template\n  - Json field values (validated by [JSON Schema](https://json-schema.org/))\n- Rest API endpoints to generate html preview or PDF\n- Web UI to generate PDF manually:\n  - HTML form are autogenerated by [JSON Schema](https://json-schema.org/)\n  - User can preview the document or generate the PDF\n- Optionnaly record all PDF generation\n\n### How does the multi-language support works?\n\nInside your pdf templates folders, you can create multiple languages files for the same pdf, in the following format: `{lang}.html`.\n\nYou also need to let a default file in case the language is not found or no language is requested.\n\nSo, for example, your folder should look something like this:\n\n```\n$ ls pdf-templates/pdf-example\ndefault.html                         de.html              fr.html                                  es.html      \n```\n\nThen, 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.\n\nFor example, the following body will try to send a german pdf:\n\n```\n{\n    ...,\n    \"lang\": \"de\"\n}\n```\n\nIf the `lang` property is not present in the body of your request, the default pdf will be sent.\n\n## This project is based on this stack\n\n- [Backend](backend/):\n  - [NodeJS](https://nodejs.org/en/) with [Koa](https://koajs.com/)\n  - [Nunjucks](https://mozilla.github.io/nunjucks/) to fill PDF Html templates\n  - [puppeteer](https://github.com/GoogleChrome/puppeteer) to rendering PDF documents (Chrome Engine)\n- [Frontend](frontend/)\n  - [ReactJS](https://en.reactjs.org/), [Axios](https://github.com/axios/axios), [React-router](https://github.com/ReactTraining/react-router)\n  - [react-jsonschema-form](https://github.com/mozilla-services/react-jsonschema-form) to generate Form from JSON Schema (need Bootstrap version `v3.3.6`)\n  - [Bootstrap](https://getbootstrap.com/)\n- Tooling\n  - [Jest](https://jestjs.io/) and [supertest](https://github.com/visionmedia/supertest) for backend tests\n  - [ESLint](https://eslint.org/)\n\n## FAQ\n\n### How can I enable Authentication system?\n\nThis project hasn't build-in authentication system, it's a internal service in your stack,\nyou must protect it by a private network or [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) system.\n\n### Why « Gibbon-pdf » name?\n\n[Gibbon](https://en.wikipedia.org/wiki/Gibbon) as an allusion to [Mandrill App](https://mandrill.com/).\n\n---\n\nInvoice examples:\n\n- https://www.sparksuite.com/open-source/invoice.html\n\nCompare with other projects:\n\n- [athenapdf](https://github.com/arachnys/athenapdf)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephane-klein%2Fgibbon-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephane-klein%2Fgibbon-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephane-klein%2Fgibbon-pdf/lists"}