Skip to content

Application that creates pdf for legeerklæringer uses https://github.com/navikt/pdfgen

License

Notifications You must be signed in to change notification settings

navikt/pale-2-pdfgen

Repository files navigation

Build status

PdfGen

Repository for pale-2 templates

Technologies & Tools

Creating a docker image

Creating a docker image should be as simple as

docker build -t pale-2-pdfgen .

Getting started

Run in development mode

To run the application with templates, data and fonts locally mounted you can use the convenience script

./run_development.sh

When running the application you can use the env var DISABLE_PDF_GET to enable GET requests at /api/v1/genpdf/<application>/<template> which looks for test data at data/<application>/<template>.json and outputs a PDF to your browser. Additionally, the template folder will be fetched on every request, and reflect any changes made since the last GET, making this ideal for developing new templates for your application.

The template and data directory structure both follow the <application>/<template> structure. Example url: http://0.0.0.0:8080/api/v1/genpdf/pale-2/pale-2

When upgrading pdfgen docker image

Remember that the version for the docker image is in 3 places, Dockerfile and 2 places in run_development.sh, remember to update all 3 places.

Notes on developing templates on Windows

It is a known issue that pdfgen's output documents look different depending on whether the template has \r\n or \n as line endings. Therefore, it is strongly recommended to configure Git to not convert newlines, as well as ensure that your editor ends its lines with LF (\n) and not CRLF (\r\n), as the former will accurately show what your templates will look like in production.

Contact

This project is maintained by navikt/teamsykmelding

Questions and/or feature requests? Please create an issue

If you work in @navikt you can reach us at the Slack channel #team-sykmelding