diff --git a/backend/certificate-pdf-service/fonts/Lato-Bold.ttf b/backend/certificate-pdf-service/fonts/Lato-Bold.ttf new file mode 100644 index 00000000..016068b4 Binary files /dev/null and b/backend/certificate-pdf-service/fonts/Lato-Bold.ttf differ diff --git a/backend/certificate-pdf-service/services/certificate_service.go b/backend/certificate-pdf-service/services/certificate_service.go index 25778fb9..008dd7b8 100644 --- a/backend/certificate-pdf-service/services/certificate_service.go +++ b/backend/certificate-pdf-service/services/certificate_service.go @@ -146,21 +146,21 @@ var landscapeDataList []CertificateDataConfig var portraitDataList = []CertificateDataConfig{ { x: 206, - y: 183, + y: 238, fontSize: 18, template: "{{.CredentialSubject.Name}}", width: 0, }, { x: 205, - y: 354, + y: 409, fontSize: 11, template: "{{.CredentialSubject.FatherName}}", width: 112, }, { - x: 487.21, - y: 354, + x: 205, + y: 644, fontSize: 11, template: "{{.IssuanceDate}}", width: 0, @@ -175,62 +175,69 @@ var portraitDataList = []CertificateDataConfig{ }, { x: 205, - y: 392, + y: 447, fontSize: 11, template: "{{ (index .Evidence 0).RefId}}", width: 0, }, { x: 487.21, - y: 392, + y: 447, fontSize: 11, template: "{{.CredentialSubject.BloodGroup}}", width: 0, }, { x: 205, - y: 429, + y: 484, fontSize: 11, template: "{{.CredentialSubject.NottoId}}", width: 0, }, { x: 487.21, - y: 429, + y: 484, fontSize: 11, template: "{{.EmergencyContact}}", width: 0, }, { x: 205, - y: 471, + y: 524, fontSize: 11, template: "{{.CredentialSubject.Pledge.Organs}}", width: 0, }, { x: 205, - y: 509, + y: 564, fontSize: 11, template: "{{.CredentialSubject.Pledge.Tissues}}", width: 0, }, { - x: 44, - y: 576, + x: 205, + y: 604, + fontSize: 11, + template: "{{.CredentialSubject.Pledge.AdditionalOrgans}}", + width: 0, + }, + { + x: 153, + y: 685, fontSize: 0, - width: 220, - height: 220, + width: 119, + height: 119, template: "{{.QrCode}}", formatter: nil, configType: ImageConfigType, }, { - x: 50, - y: 184, + x: 56, + y: 235, fontSize: 0, - width: 132, - height: 140, + width: 119, + height: 126, template: "{{.Photo}}", formatter: nil, configType: ImageConfigType, diff --git a/backend/certificate-pdf-service/services/pdf_service.go b/backend/certificate-pdf-service/services/pdf_service.go index d0c0c194..1fb1254e 100644 --- a/backend/certificate-pdf-service/services/pdf_service.go +++ b/backend/certificate-pdf-service/services/pdf_service.go @@ -34,12 +34,13 @@ func (p *PdfService) loadFonts() error { func (p *PdfService) setData(dataConfig CertificateDataConfig, certificateData Certificate) error { p.pdf.SetX(dataConfig.x) p.pdf.SetY(dataConfig.y) + p.pdf.SetFillColor(29, 29, 29) data, err := dataConfig.template.render(certificateData) if err != nil { log.Error(err) return err } - if err := p.pdf.SetFont("Lato-Regular", "", dataConfig.fontSize); err != nil { + if err := p.pdf.SetFont("Lato-Bold", "", dataConfig.fontSize); err != nil { log.Error("Error while setting font ", err) return err } diff --git a/pledgecertificates/portrait_templates_v3/Assamese_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Assamese_portrait_with_other_organs.pdf new file mode 100644 index 00000000..b3192fc3 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Assamese_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Assamese_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Assamese_portrait_without_other_organs.pdf new file mode 100644 index 00000000..c1834e10 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Assamese_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Bengali_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Bengali_portrait_with_other_organs.pdf new file mode 100644 index 00000000..c0e64143 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Bengali_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Bengali_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Bengali_portrait_without_other_organs.pdf new file mode 100644 index 00000000..d43f9c85 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Bengali_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Gujarati_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Gujarati_portrait_with_other_organs.pdf new file mode 100644 index 00000000..3f036ee4 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Gujarati_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Gujarati_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Gujarati_portrait_without_other_organs.pdf new file mode 100644 index 00000000..49e4ab9c Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Gujarati_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Hindi_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Hindi_portrait_with_other_organs.pdf new file mode 100644 index 00000000..be554fa3 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Hindi_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Hindi_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Hindi_portrait_without_other_organs.pdf new file mode 100644 index 00000000..9754108d Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Hindi_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Kannada_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Kannada_portrait_with_other_organs.pdf new file mode 100644 index 00000000..bc59f21f Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Kannada_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Kannada_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Kannada_portrait_without_other_organs.pdf new file mode 100644 index 00000000..7d384702 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Kannada_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Malayalam_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Malayalam_portrait_with_other_organs.pdf new file mode 100644 index 00000000..d0f6d592 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Malayalam_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Malayalam_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Malayalam_portrait_without_other_organs.pdf new file mode 100644 index 00000000..357cb164 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Malayalam_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Marathi_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Marathi_portrait_with_other_organs.pdf new file mode 100644 index 00000000..b6b797cd Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Marathi_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Marathi_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Marathi_portrait_without_other_organs.pdf new file mode 100644 index 00000000..d07864d8 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Marathi_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Odia_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Odia_portrait_with_other_organs.pdf new file mode 100644 index 00000000..200e8757 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Odia_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Odia_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Odia_portrait_without_other_organs.pdf new file mode 100644 index 00000000..4769ce99 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Odia_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Punjabi_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Punjabi_portrait_with_other_organs.pdf new file mode 100644 index 00000000..7b5cc075 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Punjabi_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Punjabi_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Punjabi_portrait_without_other_organs.pdf new file mode 100644 index 00000000..b1c18182 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Punjabi_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Tamil_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Tamil_portrait_with_other_organs.pdf new file mode 100644 index 00000000..b6edd9a3 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Tamil_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Tamil_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Tamil_portrait_without_other_organs.pdf new file mode 100644 index 00000000..03a37735 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Tamil_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Telugu_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Telugu_portrait_with_other_organs.pdf new file mode 100644 index 00000000..7a9994ab Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Telugu_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Telugu_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Telugu_portrait_without_other_organs.pdf new file mode 100644 index 00000000..381f7de3 Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Telugu_portrait_without_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Urdu_portrait_with_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Urdu_portrait_with_other_organs.pdf new file mode 100644 index 00000000..110a32fd Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Urdu_portrait_with_other_organs.pdf differ diff --git a/pledgecertificates/portrait_templates_v3/Urdu_portrait_without_other_organs.pdf b/pledgecertificates/portrait_templates_v3/Urdu_portrait_without_other_organs.pdf new file mode 100644 index 00000000..e7c0b4fc Binary files /dev/null and b/pledgecertificates/portrait_templates_v3/Urdu_portrait_without_other_organs.pdf differ diff --git a/schemas/Pledge.json b/schemas/Pledge.json index 4b8dca01..1cdba65c 100644 --- a/schemas/Pledge.json +++ b/schemas/Pledge.json @@ -143,18 +143,18 @@ } ], "certificateTemplates": { - "assamese_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Assamese_portrait_", - "bengali_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Bengali_portrait_", - "gujarati_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Gujarati_portrait_", - "hindi_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Hindi_portrait_", - "kannada_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Kannada_portrait_", - "malayalam_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Malayalam_portrait_", - "marathi_portrait":"https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Marathi_portrait_", - "odia_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Odia_portrait_", - "punjabi_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Punjabi_portrait_", - "tamil_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Tamil_portrait_", - "telugu_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Telugu_portrait_", - "urdu_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v2/Urdu_portrait_" + "assamese_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Assamese_portrait_", + "bengali_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Bengali_portrait_", + "gujarati_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Gujarati_portrait_", + "hindi_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Hindi_portrait_", + "kannada_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Kannada_portrait_", + "malayalam_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Malayalam_portrait_", + "marathi_portrait":"https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Marathi_portrait_", + "odia_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Odia_portrait_", + "punjabi_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Punjabi_portrait_", + "tamil_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Tamil_portrait_", + "telugu_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Telugu_portrait_", + "urdu_portrait": "https://raw.githubusercontent.com/Sunbird-RC/demo-donor-registry/main/pledgecertificates/portrait_templates_v3/Urdu_portrait_" } } }