diff --git a/CHANGELOG.md b/CHANGELOG.md index 040d756b83..dc8725701f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - Internally we were storing the `family` name field as a required property which was limiting what how you could capture the name of a person in the forms. Now we are storing it as an optional property which would make more flexible. - Remove the leftover features from the application config pages, such as certificates and informant notification. [#7156](https://github.com/opencrvs/opencrvs-core/issues/7156) +- **PDF page size** The generated PDF used to be defaulted to A4 size. Now it respects the SVG dimensions if specified ## Bug fixes diff --git a/packages/client/src/views/PrintCertificate/PDFUtils.ts b/packages/client/src/views/PrintCertificate/PDFUtils.ts index 5986a98b89..91fe857eec 100644 --- a/packages/client/src/views/PrintCertificate/PDFUtils.ts +++ b/packages/client/src/views/PrintCertificate/PDFUtils.ts @@ -244,6 +244,10 @@ export function svgToPdfTemplate(svg: string, offlineResource: IOfflineData) { if (widthValue && heightValue) { const width = Number.parseInt(widthValue) const height = Number.parseInt(heightValue) + pdfTemplate.definition.pageSize = { + width, + height + } if (width > height) { pdfTemplate.definition.pageOrientation = 'landscape' }