Skip to content

pagopa/pagopa-template-notice-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧾 pagopa-template-notice-pdf

All PDF templates of the notice designed by pagoPA

Requirements

  • Node JS (see .node-version file), optional see nvm
  • yarn

Dependencies

How to generate the PDF notice

  1. Go to the src folder and run yarn to install all the required packages
  2. Based on your needs, you can run one of the following commands:
    • Single instalment
      • w/o Poste notice: $ yarn generate-single-instalment
      • w/ Poste notice: $ yarn generate-single-instalment-poste
    • Multiple instalments: you can configure the number of instalments by changing the values contained in the notice.instalments.items array from the notice-many-instalments.json file
      • w/o Poste notice: $ yarn generate-instalments
      • w/ Poste notice: $ yarn generate-instalments-poste
    • Many instalments (more than nine): $ yarn generate-many-instalments
    • Road traffic offence
      • w/o Poste notice: $ yarn generate-cds-infraction
      • w/ Poste notice: $ yarn generate-cds-infraction-poste
      • for thermal printing: $ yarn generate-cds-infraction-thermal and $ yarn generate-cds-infraction-thermal-immediate-notification
    • All of the above: $ yarn run-all-generate
  3. If everything is okay, you will see a PDF file with the relative PDF template name in the output_template folder (starting from the root folder). For example, if you generate the most basic PDF template, you will see a PDF file named TemplateSingleInstalment.pdf in the same folder.

Breakdown of pages by number of instalments

without Poste paying-in slip (bollettino postale

Total instalments² First page³ Second page
№ cols № cols № rows
2 2 - -
3 3 - -
4 2 2 1
5 2 3 1
6 2 2 2
7 3 2 2
8 2 3 2
9 3 3 2

¹ getPaginationData function in the paginator.js helper file translates this breakdown into code
² For more than nine instalments please use the many instalments template
³ The first page always has a maximum of one row, as it contains all the main information

with pre-filled Poste paying-in slip (bollettino postale)¹ ²

Total instalments³ № instalments
2ⁿᵈ page 3ʳᵈ page 4ᵗʰ page
2 2 - -
3 3 - -
4 2 2 -
5 2 3 -
6 3 3 -
7 3 2 2
8 2 3 3
9 3 3 3

¹ getPaginationDataPoste function in the paginator.js helper file translates this breakdown into code
² The first page is omitted because it always shows only the single instalment. Other pages can show a maximum of three instalments per page, as payment slips take up space
³ There's no current template that supports the case with more than nine instalments


Python Script

Note

The python script is used for Stampa Avvisi

The create_templates_zip.py file is a Python script that creates a *.zip file for each template, containing the template itself and its associated CSS and asset files. All zip files will be created in the ./output_zip folder.

Note: In the ZIP archive, the hbs template is renamed to template.html.

How to run

Use this command, from the root folder:

$ python3 ./create_templates_zip.py

Related PDF templates