Skip to content

Commit 09c8c0d

Browse files
committed
add multi-page + security paper guidance in certificate configuration
1 parent db32dce commit 09c8c0d

File tree

1 file changed

+52
-12
lines changed

1 file changed

+52
-12
lines changed

v1.9.0/setup/3.-installation/3.2-set-up-your-own-country-configuration/3.2.7-configure-declaration-forms/3.2.6-configure-certificate-templates.md

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ To get an idea of what we mean, take a look at the Farajaland example certificat
7070
| V2 Birth | <p><a href="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/v2.birth-certificate.svg">Birth Certificate</a></p><p><a href="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/v2.birth-certificate-certified-copy.svg">Birth Certified Copy</a></p> |
7171
| V2 Death | <p><a href="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/v2.death-certificate.svg">Death Certificate</a></p><p><a href="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/v2.death-certificate-certified-copy.svg">Death Certified Copy</a></p> |
7272

73-
74-
7573
### **Step 2: Add custom font files**
7674

7775
Any fonts can be used in your certificate provided you have permission and are prepared to accept the client load time required to render the font file.
@@ -94,7 +92,7 @@ An example v2 certificate config looks like this:
9492
defaultMessage: 'Birth Certificate copy',
9593
description: 'The label for a birth certificate'
9694
},
97-
isDefault: true,
95+
isDefault: true,
9896
fee: {
9997
onTime: 7, // Fees assocaited with the certificate
10098
late: 10.6,
@@ -118,12 +116,54 @@ An example v2 certificate config looks like this:
118116
}
119117
```
120118

121-
* The **id** property must be unique.
122-
* **isV2Template** must be set to true
123-
* The **event** property must be set to the supported `Event.<prop>` provided to you by TypeScript.
124-
* The **label** property must be a [react-intl formatjs ](https://www.npmjs.com/package/react-intl)object with a translation for the visible label that you wish to apply to this certificate in the select field that is available to the user. Appropriate translations must exist in your client.csv file for the **label.id** where necessary. You can learn about how to configure OpenCRVS content translation in the section: [Managing Language Content](../3.2.5-set-up-application-settings/3.2.9.1-managing-language-content).
125-
* The **isDefault** property can only be applied to **one item per event**. Its the first item users will see in the select UI form field when choosing a certificate.
126-
* The **fee** property allows you to configure unique fees for the certificate type. Defaults are applied from applcation-config.ts
127-
* The **svgUrl** property is self explanatory. The SVG file must exist in this location.
128-
* The **fonts** property, as above, must point to ttf font files that exist in the referenced location.
129-
* **conditionals** allow you to set visibility conditionals to configure the business logic from metadata, deciding when and how often this template should be available for printing. In some countries, legal requirements state that certain templates should only be printed once, and only then certified copies should be printed.
119+
- The **id** property must be unique.
120+
- **isV2Template** must be set to true
121+
- The **event** property must be set to the supported `Event.<prop>` provided to you by TypeScript.
122+
- The **label** property must be a [react-intl formatjs ](https://www.npmjs.com/package/react-intl)object with a translation for the visible label that you wish to apply to this certificate in the select field that is available to the user. Appropriate translations must exist in your client.csv file for the **label.id** where necessary. You can learn about how to configure OpenCRVS content translation in the section: [Managing Language Content](../3.2.5-set-up-application-settings/3.2.9.1-managing-language-content).
123+
- The **isDefault** property can only be applied to **one item per event**. Its the first item users will see in the select UI form field when choosing a certificate.
124+
- The **fee** property allows you to configure unique fees for the certificate type. Defaults are applied from applcation-config.ts
125+
- The **svgUrl** property is self explanatory. The SVG file must exist in this location.
126+
- The **fonts** property, as above, must point to ttf font files that exist in the referenced location.
127+
- **conditionals** allow you to set visibility conditionals to configure the business logic from metadata, deciding when and how often this template should be available for printing. In some countries, legal requirements state that certain templates should only be printed once, and only then certified copies should be printed.
128+
129+
## Multi-Page Certificate Support
130+
131+
Previously, our certificate generation system only supported single-page SVG certificate templates. Some countries might need to issue certificates that span two or more pages, which required extending our SVG→PDF pipeline and certificate preview UI.
132+
133+
We have introduced first-class multi-page certificate support in this version.
134+
135+
The feature allows:
136+
137+
- Multiple pages defined inside one SVG using data-page markers
138+
- Automatic splitting of the SVG into page-specific PDF content
139+
- Correct page-by-page preview for staff verification before final document generation
140+
- Compatibility with existing absolutely-positioned svg templates
141+
- Backwards compatibility with single-page SVG templates
142+
143+
### How Multi-Page Certificates Are Defined
144+
145+
Multi-page templates are delivered as one master SVG containing different page sections.
146+
Each page is wrapped in a <g> element marked with the attribute:
147+
148+
```
149+
<g data-page="1">
150+
...
151+
</g> <!-- Content for page 1 goes here-->
152+
153+
<g data-page="2">
154+
... <!-- Content for page 1 goes here-->
155+
</g>
156+
```
157+
158+
An example certificate configuration [can be found here](https://github.com/opencrvs/opencrvs-countryconfig/blob/release-v1.9.2/src/api/certificates/source/v2.tennis-club-membership-certificate-multipage.svg?short_path=6fa63f6#L2)
159+
160+
## Hiding Header and Footer on Security Paper Certificates
161+
162+
Security-paper–based certificates already contain their own official background, headers, footers, qr code printed on the physical security paper itself.
163+
164+
Because of that, No app-generated header, footer or qr code must appear.
165+
Any extra header/footer/qr code would overlap the preprinted design and invalidate the document.
166+
167+
In such case, we need to design a svg template with absolute positioned svg elements including header, footer and qr code. And once it renders correctly, we add condition to show it dynamically using the `$review` helper variable. In the review mode, it will show the header, footer and qr code. But when the pdf will be printed, the header, footer and qr code will be ommitted so that content from the security paper can take place.
168+
169+
An example certificate configuration [can be found here](https://github.com/opencrvs/opencrvs-countryconfig/blob/release-v1.9.2/src/api/certificates/source/v2.birth-certificate.svg?short_path=da46a2e#L4)

0 commit comments

Comments
 (0)