Skip to content

Commit 8a1709e

Browse files
committed
add multi-page + security paper guidance in certificate configuration in changelog
1 parent db32dce commit 8a1709e

File tree

1 file changed

+54
-12
lines changed

1 file changed

+54
-12
lines changed

v1.7.0/setup/3.-installation/3.2-set-up-your-own-country-configuration/3.2.6-configure-certificate-templates.md

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Once you have designed your certificate templates you are ready to configure the
77

88
### Step 1. Configuring certificate SVG files
99

10-
The next step is for you to design and configure your certificate template [SVG](https://en.wikipedia.org/wiki/SVG) files. You can have as many different certificate as you like, represented as different [SVG](https://en.wikipedia.org/wiki/SVG) files, for each vital event. You use **\{{** [**handlebar**](https://handlebarsjs.com/) **\}}** syntax to mark where in the SVG you wish the citizen data to be rendered.  
10+
The next step is for you to design and configure your certificate template [SVG](https://en.wikipedia.org/wiki/SVG) files. You can have as many different certificate as you like, represented as different [SVG](https://en.wikipedia.org/wiki/SVG) files, for each vital event. You use **\{{** [**handlebar**](https://handlebarsjs.com/) **\}}** syntax to mark where in the SVG you wish the citizen data to be rendered.  
1111

1212
All your SVGs should be placed in the [**src/api/certificates/source**](https://github.com/opencrvs/opencrvs-countryconfig/tree/develop/src/api/certificates/source) folder.
1313

@@ -18,13 +18,13 @@ To get an idea of what we mean, take a look at the Farajaland example certificat
1818
| Birth | <p><a href="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/birth-certificate-certified-copy.svg">Birth Certificate</a></p><p><a href="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/birth-certificate-certified-copy.svg">Birth Certified Copy</a></p> | [Default birth handlebars](https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/form/birth/certificate-handlebars.ts) |
1919
| Death | <p><a href="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/death-certificate-certified-copy.svg">Death Certificate</a></p><p><a href="https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/api/certificates/source/death-certificate-certified-copy.svg">Death Certified Copy</a></p> | [Default death handlebars](https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/form/death/certficate-handlebars.ts) |
2020

21-
We have supplied helper handlebars for many use cases. Some need explanation, or if you feel that you do not have a handlebar for your specific needs, please discuss with us on [Github](https://github.com/opencrvs/opencrvs-core/discussions) or email us at [[email protected]](mailto:[email protected]) and we can work on a new handlebar for you. \
21+
We have supplied helper handlebars for many use cases. Some need explanation, or if you feel that you do not have a handlebar for your specific needs, please discuss with us on [Github](https://github.com/opencrvs/opencrvs-core/discussions) or email us at [[email protected]](mailto:[email protected]) and we can work on a new handlebar for you. \
2222
\
2323
As an example of a handlebar that needs explanation: `{{placeOfBirth}}` is used if a user selects a pre-loaded [health facility](3.2.3-set-up-cr-offices-and-health-facilities/3.2.3.2-prepare-source-file-for-health-facilities.md). This handlebar dynamically returns the location hierarchy, e.g. "district, state" to render based on the location of the [health facility](3.2.3-set-up-cr-offices-and-health-facilities/3.2.3.2-prepare-source-file-for-health-facilities.md). You can see that in our place of birth location in the SVG, we have if/else logic to handle whatever the user chooses to enter into the form.
2424

25-
Sometimes you need to format the handlebars. For example to wrap text, or perform any number of manipulations. You can configure ["handlebar helper"](https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/form/common/certificate/handlebars/helpers.ts) functions to do this.
25+
Sometimes you need to format the handlebars. For example to wrap text, or perform any number of manipulations. You can configure ["handlebar helper"](https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/form/common/certificate/handlebars/helpers.ts) functions to do this.
2626

27-
We have some configurable helper functions to get you started [here](https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/form/common/certificate/handlebars/helpers.ts). We also have some [built in](https://github.com/opencrvs/opencrvs-core/blob/cf1cb763abae7211fa3648a742d3763fd947eaa3/packages/client/src/views/PrintCertificate/PDFUtils.ts#L183) to opencrvs-core. Such as this one, giving you access to every property that exists in a FHIR Location.
27+
We have some configurable helper functions to get you started [here](https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/form/common/certificate/handlebars/helpers.ts). We also have some [built in](https://github.com/opencrvs/opencrvs-core/blob/cf1cb763abae7211fa3648a742d3763fd947eaa3/packages/client/src/views/PrintCertificate/PDFUtils.ts#L183) to opencrvs-core. Such as this one, giving you access to every property that exists in a FHIR Location.
2828

2929
```xml
3030
{{location districtPlaceofbirthId 'name'}}
@@ -39,7 +39,7 @@ Example:\
3939
`<text fill="#222222" xml:space="preserve" style="white-space: pre" font-family="Noto Sans-Bold" font-size="16" font-weight="bold" letter-spacing="0px"><tspan x="86.6699" y="444.268">{{eventDate}}&#10;</tspan></text>`\\
4040

4141
{% hint style="info" %}
42-
Watching the videos below will really help you understand how to configure the certificate. The time spent watching the video will make your life much easier!
42+
Watching the videos below will really help you understand how to configure the certificate. The time spent watching the video will make your life much easier!
4343
{% endhint %}
4444

4545
{% embed url="https://youtu.be/Oh5sDYK4GNo" %}
@@ -109,10 +109,52 @@ onst certificateConfigs: ICertificateConfigData[] = [
109109
}, ...
110110
```
111111

112-
* The **id** property must be unique.
113-
* The **event** property must be set to the supported `Event.<prop>` provided to you by TypeScript.
114-
* 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/).
115-
* 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.
116-
* The **fee** property allows you to configure unique fees for the certificate type. Defaults are applied from applcation-config.ts
117-
* The **svgUrl** property is self explanatory. The SVG file must exist in this location.
118-
* The **fonts** property, as above, must point to ttf font files that exist in the referenced location.
112+
- The **id** property must be unique.
113+
- The **event** property must be set to the supported `Event.<prop>` provided to you by TypeScript.
114+
- 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/).
115+
- 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.
116+
- The **fee** property allows you to configure unique fees for the certificate type. Defaults are applied from applcation-config.ts
117+
- The **svgUrl** property is self explanatory. The SVG file must exist in this location.
118+
- The **fonts** property, as above, must point to ttf font files that exist in the referenced location.
119+
120+
## Multi-Page Certificate Support
121+
122+
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.
123+
124+
We have introduced first-class multi-page certificate support in this version.
125+
126+
The feature allows:
127+
128+
- Multiple pages defined inside one SVG using data-page markers
129+
- Automatic splitting of the SVG into page-specific PDF content
130+
- Correct page-by-page preview for staff verification before final document generation
131+
- Compatibility with existing absolutely-positioned svg templates
132+
- Backwards compatibility with single-page SVG templates
133+
134+
### How Multi-Page Certificates Are Defined
135+
136+
Multi-page templates are delivered as one master SVG containing different page sections.
137+
Each page is wrapped in a <g> element marked with the attribute:
138+
139+
```
140+
<g data-page="1">
141+
...
142+
</g> <!-- Content for page 1 goes here-->
143+
144+
<g data-page="2">
145+
... <!-- Content for page 1 goes here-->
146+
</g>
147+
```
148+
149+
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)
150+
151+
## Hiding Header and Footer on Security Paper Certificates
152+
153+
Security-paper–based certificates already contain their own official background, headers, footers, qr code printed on the physical security paper itself.
154+
155+
Because of that, No app-generated header, footer or qr code must appear.
156+
Any extra header/footer/qr code would overlap the preprinted design and invalidate the document.
157+
158+
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.
159+
160+
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)