You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 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
+52-12Lines changed: 52 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,8 +70,6 @@ To get an idea of what we mean, take a look at the Farajaland example certificat
| V2 Death | <p><ahref="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/v2.death-certificate.svg">Death Certificate</a></p><p><ahref="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/v2.death-certificate-certified-copy.svg">Death Certified Copy</a></p> |
72
72
73
-
74
-
75
73
### **Step 2: Add custom font files**
76
74
77
75
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:
94
92
defaultMessage: 'Birth Certificate copy',
95
93
description: 'The label for a birth certificate'
96
94
},
97
-
isDefault: true,
95
+
isDefault: true,
98
96
fee: {
99
97
onTime: 7, // Fees assocaited with the certificate
100
98
late: 10.6,
@@ -118,12 +116,54 @@ An example v2 certificate config looks like this:
118
116
}
119
117
```
120
118
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