Templates - trifork/dpk-docs GitHub Wiki

New templates

Templates should be sent to Jakob Østergaard Rasmussen ([email protected]). Templates should be provided in DOCX, ODT or similar formats, if they include textual examples such as names, addresses, links, and text intended for replacement with recipient-specific information. Alternatively, templates can be in PDF format, if they do not include text that requires later replacement with recipient-specific data. If sending a PDF with intended dynamic data, please remove lines with dynamic data from the PDF and send that along with an example PDF of the desired result.

Edible formats like DOCX and ODT are preferred.

It can take up to a day for us to prepare a template - based on how complex the template is.

It is possible to update existing templates (besides creating a new one with a new identifier). It may take up to 30 minutes before the updated version is used.

Template identifiers

A PDF template is uniquely identified by a string identifier, which is used in HTTP POST requests to specify the exact templates for physical and digital letters, denoted by the keys template_digital and template_physical.

The template_digital key may not be empty, while template_physical can be omitted if physical post is not desired.

Existing Templates

Test

Identifier Mandatory Substitution Values Optional Substitution Values
http://pdf.nspop.dk/fgvhr/20241001/digital/BekraeftelseRegistreringFravalg - linkTilSundhedDk1 - linkTilSundhedDk2 - ikrafttraedelsesdato - date
http://pdf.nspop.dk/fgvhr/20241001/physical/BekraeftelseRegistreringFravalg - linkTilSundhedDk1 - linkTilSundhedDk2 - ikrafttraedelsesdato - date
http://pdf.nspop.dk/fgvhr/20241001/digital/BekraeftelseFortrydelseFravalg - linkTilSundhedDk - date
http://pdf.nspop.dk/fgvhr/20241001/physical/BekraeftelseFortrydelseFravalg - linkTilSundhedDk - date
http://pdf.nspop.dk/fgvhr/20241001/digital/PaamindelseRegistreringFravalg - linkTilSundhedDk - date
http://pdf.nspop.dk/fgvhr/20241001/physical/PaamindelseRegistreringFravalg - linkTilSundhedDk - date
fgvhr/20241218/digital/BekraeftelseRegistreringFravalg - ikrafttraedelsesdato - date
fgvhr/20241218/physical/BekraeftelseRegistreringFravalg - ikrafttraedelsesdato - date
fgvhr/20241218/digital/BekraeftelseFortrydelseFravalg - date
fgvhr/20241218/physical/BekraeftelseFortrydelseFravalg - date
fgvhr/20241218/digital/PaamindelseRegistreringFravalg - date
fgvhr/20241218/physical/PaamindelseRegistreringFravalg - date

Prod

Identifier Mandatory Substitution Values Optional Substitution Values
fgvhr/20241218/digital/BekraeftelseRegistreringFravalg - ikrafttraedelsesdato - date
fgvhr/20241218/physical/BekraeftelseRegistreringFravalg - ikrafttraedelsesdato - date
fgvhr/20241218/digital/BekraeftelseFortrydelseFravalg - date
fgvhr/20241218/physical/BekraeftelseFortrydelseFravalg - date
fgvhr/20241218/digital/PaamindelseRegistreringFravalg - date
fgvhr/20241218/physical/PaamindelseRegistreringFravalg - date

A description of (generic) optional substitution values:

  • date: This will override the date specified in the top-left side of the letter. If no date is provided, the PDF service will use the current date at the time of PDF generation.

Strålfors letter limitations

You can upload PDF files to SConnect Brevtester (https://brevtest.sconnect.dk/) to verify the template layout. It's important to keep the upper-left section of a Strålfors letter free of any text, as this text won't appear in the printed letter. See figure below. In this instance, the date will be omitted from the printed letter by Strålfors.

image

Fonts

The iText library, which is employed for rendering PDF files, comes with a predefined set of fonts. The following fonts are included with iText:

  • times-roman, times-italic, times-bold, times-bolditalic
  • helvetica, helvetica-bold, helvetica-boldoblique, helvetica-oblique
  • courier, courier-boldoblique, courier-bold, courier-oblique
  • zapfdingbats
  • symbol

Currently, two additional fonts have been added to support the fonts utilized in the provided templates:

  • calibri
  • corbel

Utilizing fonts not listed above will require additional configuration effort for templates compared to using fonts that are already registered. This will be reflected in the amount of hours spent configuring new templates.