From 5630de1198b405685e5a1365b3e2a52d460a9fb7 Mon Sep 17 00:00:00 2001 From: dharani-beehyv Date: Fri, 10 Jul 2026 12:27:12 +0530 Subject: [PATCH 1/3] Release 35: promote develop to master (#773) * feat: add case-summary pdf data/format config (#5754) (#771) New pdf-service template for the Case Summary PDF: header block, case-party details table, and repeating hearing-wise BoTD table. Addresses https://github.com/pucardotorg/dristi/issues/5754 Co-authored-by: Claude Opus 4.8 * fix(pdf): party details table for summons to witness (#5871) (#772) * feat(pdf): add party details table to summons-to-witness templates Removes the WHEREAS clause that incorrectly printed the witness name in the accused/respondent slot, and adds the complainant/accused party details table (as in orders and applications) so multiple accused are covered, for both summons-witness and summons-witness-e-post. Addresses https://github.com/pucardotorg/dristi/issues/5871 Co-Authored-By: Claude Opus 4.8 * fix(pdf): add spacer rows between witness party-table sections Adjacent {{/complainantList}} and {{#accusedList}} markers left two empty rows that pdfmake rejected ('Malformed table row, a cell is undefined'), producing a blank PDF. Add spacer rows between sections (as in case-summary) so a real row separates the markers. Addresses https://github.com/pucardotorg/dristi/issues/5871 Co-Authored-By: Claude Opus 4.8 --------- Co-authored-by: Claude Opus 4.8 --------- Co-authored-by: Claude Opus 4.8 --- pdf-service/data-config/case-summary.json | 68 ++++++ .../data-config/summons-witness-epost.json | 16 ++ pdf-service/data-config/summons-witness.json | 16 ++ pdf-service/format-config/case-summary.json | 226 ++++++++++++++++++ .../format-config/summons-witness-epost.json | 120 +++++++++- .../format-config/summons-witness.json | 108 ++++++++- 6 files changed, 552 insertions(+), 2 deletions(-) create mode 100644 pdf-service/data-config/case-summary.json create mode 100644 pdf-service/format-config/case-summary.json diff --git a/pdf-service/data-config/case-summary.json b/pdf-service/data-config/case-summary.json new file mode 100644 index 00000000..511d83bd --- /dev/null +++ b/pdf-service/data-config/case-summary.json @@ -0,0 +1,68 @@ +{ + "key": "case-summary", + "DataConfigs": { + "serviceName": "pdf-service", + "version": "1.0.0", + "baseKeyPath": "$.Data.*", + "entityIdPath": "$.id", + "isCommonTableBorderRequired": true, + "mappings": [ + { + "topic": "common-pdf-generation-3", + "mappings": [ + { + "direct": [ + { + "variable": "courtName", + "value": { + "path": "$.courtName" + } + }, + { + "variable": "caseNumber", + "value": { + "path": "$.caseNumber" + } + }, + { + "variable": "caseName", + "value": { + "path": "$.caseName" + } + }, + { + "variable": "date", + "value": { + "path": "$.date" + } + }, + { + "variable": "complainantList", + "value": { + "path": "$.complainantList" + }, + "type": "function", + "format": " var i = 0; for (i=0;i< type.length;i++) {type[i]['index'] = i + 1;} return type;" + }, + { + "variable": "accusedList", + "value": { + "path": "$.accusedList" + }, + "type": "function", + "format": " var i = 0; for (i=0;i< type.length;i++) {type[i]['index'] = i + 1;} return type;" + }, + { + "variable": "hearings", + "value": { + "path": "$.hearings" + }, + "type": "index" + } + ] + } + ] + } + ] + } +} diff --git a/pdf-service/data-config/summons-witness-epost.json b/pdf-service/data-config/summons-witness-epost.json index 5e467a2f..c8c3b266 100644 --- a/pdf-service/data-config/summons-witness-epost.json +++ b/pdf-service/data-config/summons-witness-epost.json @@ -137,6 +137,22 @@ "path": "$.address.pincode", "defaultValue": "NA" } + }, + { + "variable": "complainantList", + "value": { + "path": "$.complainantList" + }, + "type": "function", + "format": " var i = 0; for (i=0;i< type.length;i++) {type[i]['index'] = i + 1;} return type;" + }, + { + "variable": "accusedList", + "value": { + "path": "$.accusedList" + }, + "type": "function", + "format": " var i = 0; for (i=0;i< type.length;i++) {type[i]['index'] = i + 1;} return type;" } ] } diff --git a/pdf-service/data-config/summons-witness.json b/pdf-service/data-config/summons-witness.json index d5e5df2a..8a2bde2f 100644 --- a/pdf-service/data-config/summons-witness.json +++ b/pdf-service/data-config/summons-witness.json @@ -137,6 +137,22 @@ "path": "$.address.pincode", "defaultValue": "NA" } + }, + { + "variable": "complainantList", + "value": { + "path": "$.complainantList" + }, + "type": "function", + "format": " var i = 0; for (i=0;i< type.length;i++) {type[i]['index'] = i + 1;} return type;" + }, + { + "variable": "accusedList", + "value": { + "path": "$.accusedList" + }, + "type": "function", + "format": " var i = 0; for (i=0;i< type.length;i++) {type[i]['index'] = i + 1;} return type;" } ] } diff --git a/pdf-service/format-config/case-summary.json b/pdf-service/format-config/case-summary.json new file mode 100644 index 00000000..94faf600 --- /dev/null +++ b/pdf-service/format-config/case-summary.json @@ -0,0 +1,226 @@ +{ + "key": "case-summary", + "config": { + "pageSize": "A4", + "pageMargins": [40, 40, 40, 40], + "content": [ + { + "table": { + "widths": ["*"], + "body": [ + [ + { + "stack": [ + { + "text": "Before {{courtName}}", + "style": "header" + }, + { + "text": "Case No: {{caseNumber}}", + "style": "header", + "margin": [0, 5, 0, 0] + }, + { + "text": "In the matter of: {{caseName}}", + "style": "header", + "margin": [0, 5, 0, 0] + }, + { + "text": "Date: {{date}}", + "style": "header", + "margin": [0, 5, 0, 15] + }, + { + "style": "table", + "table": { + "widths": ["30%", "70%"], + "body": [ + "{{#complainantList}}", + [ + { + "text": "Complainant {{index}}", + "style": "tableText", + "border": [true, true, true, true] + }, + { + "text": "{{name}}", + "style": "tableText", + "border": [true, true, true, true] + } + ], + [ + { + "text": "Advocate(s)", + "style": "tableText", + "border": [true, true, true, true] + }, + { + "text": "{{listOfAdvocatesRepresenting}}", + "style": "tableText", + "border": [true, true, true, true] + } + ], + "{{/complainantList}}", + [ + { + "text": "", + "style": "tableText", + "border": [true, false, false, false] + }, + { + "text": "", + "style": "tableText", + "border": [false, false, true, false] + } + ], + "{{#accusedList}}", + [ + { + "text": "Accused {{index}}", + "style": "tableText", + "border": [true, true, true, true] + }, + { + "text": "{{name}}", + "style": "tableText", + "border": [true, true, true, true] + } + ], + [ + { + "text": "Advocate(s)", + "style": "tableText", + "border": [true, true, true, true] + }, + { + "text": "{{listOfAdvocatesRepresenting}}", + "style": "tableText", + "border": [true, true, true, true] + } + ], + "{{/accusedList}}", + [ + { + "text": "", + "style": "tableText", + "border": [true, false, false, false] + }, + { + "text": "", + "style": "tableText", + "border": [false, false, true, false] + } + ], + [ + { + "text": "Offence", + "style": "tableText", + "border": [true, true, true, true] + }, + { + "text": "S.138 of the Negotiable Instruments Act, 1881", + "style": "tableText", + "border": [true, true, true, true] + } + ] + ] + } + }, + { + "text": "", + "margin": [0, 0, 0, 15] + }, + { + "style": "hearingTable", + "table": { + "headerRows": 1, + "widths": ["35%", "65%"], + "body": [ + [ + { + "text": "Date and Purpose of Hearing", + "style": "hearingTableHeader", + "border": [true, true, true, true] + }, + { + "text": "BoTD", + "style": "hearingTableHeader", + "border": [true, true, true, true] + } + ], + "{{#hearings}}", + [ + { + "stack": [ + { + "text": "{{date}}", + "style": "hearingDate" + }, + { + "text": "{{purpose}}", + "style": "hearingPurpose" + } + ], + "border": [true, true, true, true] + }, + { + "text": "{{businessOfTheDay}}", + "style": "hearingBotd", + "border": [true, true, true, true] + } + ], + "{{/hearings}}" + ] + } + } + ], + "alignment": "left", + "margin": [0, 20, 0, 20] + } + ] + ] + }, + "layout": "noBorders" + } + ], + "styles": { + "header": { + "fontSize": 14, + "bold": true, + "alignment": "center", + "margin": [0, 0, 0, 0] + }, + "table": { + "fontSize": 13 + }, + "tableText": { + "fontSize": 13, + "margin": [2, 5, 2, 5] + }, + "hearingTable": { + "fontSize": 12 + }, + "hearingTableHeader": { + "fontSize": 12, + "bold": true, + "fillColor": "#EAEAEA", + "margin": [4, 6, 4, 6] + }, + "hearingDate": { + "fontSize": 12, + "bold": true, + "margin": [4, 6, 4, 2] + }, + "hearingPurpose": { + "fontSize": 11, + "color": "#3D3C3C", + "margin": [4, 0, 4, 6] + }, + "hearingBotd": { + "fontSize": 11, + "alignment": "justify", + "margin": [4, 6, 4, 6] + } + } + } +} diff --git a/pdf-service/format-config/summons-witness-epost.json b/pdf-service/format-config/summons-witness-epost.json index 088a5237..f05d317a 100644 --- a/pdf-service/format-config/summons-witness-epost.json +++ b/pdf-service/format-config/summons-witness-epost.json @@ -53,6 +53,108 @@ }, "layout": "noBorders" }, + { + "text": "Next Hearing Date: {{hearingDate}}", + "style": "next-hearing-date", + "layout": "noBorders" + }, + { + "style": "party-table", + "table": { + "widths": ["30%", "70%"], + "body": [ + "{{#complainantList}}", + [ + { + "text": "Complainant {{index}}", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{name}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + [ + { + "text": "Advocate(s)", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{listOfAdvocatesRepresenting}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + "{{/complainantList}}", + [ + { + "text": "", + "style": "party-cell", + "border": [true, false, false, false] + }, + { + "text": "", + "style": "party-cell", + "border": [false, false, true, false] + } + ], + "{{#accusedList}}", + [ + { + "text": "Accused {{index}}", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{name}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + [ + { + "text": "Advocate(s)", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{listOfAdvocatesRepresenting}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + "{{/accusedList}}", + [ + { + "text": "", + "style": "party-cell", + "border": [true, false, false, false] + }, + { + "text": "", + "style": "party-cell", + "border": [false, false, true, false] + } + ], + [ + { + "text": "Offence", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "S.138 of the Negotiable Instruments Act, 1881", + "style": "party-cell", + "border": [true, true, true, true] + } + ] + ] + }, + "margin": [0, 10, 0, 10] + }, { "style": "form-body", "table": { @@ -66,7 +168,7 @@ ], [ { - "text": "WHEREAS complaint has been made before me that {{respondentName}} of {{respondentAddress}} has (or is suspected to have) committed the offence U/s. 138 of Negotiable Instruments Act, and it appears to me that you are likely to give material evidence or to produce any document or other thing for the prosecution;", + "text": "In the above mentioned case, involving the above listed parties, it appears to me that you are likely to give material evidence or to produce any document or other thing;", "style": "form-sub-body" } ], @@ -137,6 +239,22 @@ } ], "styles": { + "next-hearing-date": { + "fontSize": 12, + "bold": true, + "color": "#000000", + "alignment": "right", + "margin": [0, 0, 0, 10] + }, + "party-table": { + "fontSize": 12, + "color": "#484848" + }, + "party-cell": { + "fontSize": 12, + "color": "#484848", + "margin": [2, 5, 2, 5] + }, "form-header": { "color": "#484848", "fontFamily": "Roboto", diff --git a/pdf-service/format-config/summons-witness.json b/pdf-service/format-config/summons-witness.json index 3f2ccb6d..4588e4c2 100644 --- a/pdf-service/format-config/summons-witness.json +++ b/pdf-service/format-config/summons-witness.json @@ -58,6 +58,103 @@ "style": "next-hearing-date", "layout": "noBorders" }, + { + "style": "party-table", + "table": { + "widths": ["30%", "70%"], + "body": [ + "{{#complainantList}}", + [ + { + "text": "Complainant {{index}}", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{name}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + [ + { + "text": "Advocate(s)", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{listOfAdvocatesRepresenting}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + "{{/complainantList}}", + [ + { + "text": "", + "style": "party-cell", + "border": [true, false, false, false] + }, + { + "text": "", + "style": "party-cell", + "border": [false, false, true, false] + } + ], + "{{#accusedList}}", + [ + { + "text": "Accused {{index}}", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{name}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + [ + { + "text": "Advocate(s)", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{listOfAdvocatesRepresenting}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + "{{/accusedList}}", + [ + { + "text": "", + "style": "party-cell", + "border": [true, false, false, false] + }, + { + "text": "", + "style": "party-cell", + "border": [false, false, true, false] + } + ], + [ + { + "text": "Offence", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "S.138 of the Negotiable Instruments Act, 1881", + "style": "party-cell", + "border": [true, true, true, true] + } + ] + ] + }, + "margin": [0, 10, 0, 10] + }, { "style": "form-body", "table": { @@ -71,7 +168,7 @@ ], [ { - "text": "WHEREAS complaint has been made before me that {{respondentName}} of {{respondentAddress}} has (or is suspected to have) committed the offence U/s. 138 of Negotiable Instruments Act, and it appears to me that you are likely to give material evidence or to produce any document or other thing for the prosecution;", + "text": "In the above mentioned case, involving the above listed parties, it appears to me that you are likely to give material evidence or to produce any document or other thing;", "style": "form-sub-body" } ], @@ -123,6 +220,15 @@ "alignment": "right", "margin": [0, 0, 0, 10] }, + "party-table": { + "fontSize": 12, + "color": "#484848" + }, + "party-cell": { + "fontSize": 12, + "color": "#484848", + "margin": [2, 5, 2, 5] + }, "form-header": { "color": "#484848", "fontFamily": "Roboto", From a47c0a8b90569a44724baa6afc42fa7bffbd6104 Mon Sep 17 00:00:00 2001 From: TusharKatiyar2002 Date: Tue, 14 Jul 2026 15:06:35 +0530 Subject: [PATCH 2/3] warrant to witness pdf template changes --- .../data-config/witness-warrant-pdf.json | 24 +++- .../format-config/witness-warrant-pdf.json | 110 +++++++++++++++++- 2 files changed, 128 insertions(+), 6 deletions(-) diff --git a/pdf-service/data-config/witness-warrant-pdf.json b/pdf-service/data-config/witness-warrant-pdf.json index 8e327c1b..c3e83274 100644 --- a/pdf-service/data-config/witness-warrant-pdf.json +++ b/pdf-service/data-config/witness-warrant-pdf.json @@ -20,19 +20,35 @@ } }, { - "variable": "respondentName", + "variable": "respondentAddress", "value": { - "path": "$.respondentName", + "path": "$.respondentAddress", "defaultValue": "NA" } }, { - "variable": "respondentAddress", + "variable": "witnessName", "value": { - "path": "$.respondentAddress", + "path": "$.witnessName", "defaultValue": "NA" } }, + { + "variable": "complainantList", + "value": { + "path": "$.complainantList" + }, + "type": "function", + "format": " var i = 0; for (i=0;i< type.length;i++) {type[i]['index'] = i + 1;} return type;" + }, + { + "variable": "accusedList", + "value": { + "path": "$.accusedList" + }, + "type": "function", + "format": " var i = 0; for (i=0;i< type.length;i++) {type[i]['index'] = i + 1;} return type;" + }, { "variable": "caseName", "value": { diff --git a/pdf-service/format-config/witness-warrant-pdf.json b/pdf-service/format-config/witness-warrant-pdf.json index ec5021a9..f04365fc 100644 --- a/pdf-service/format-config/witness-warrant-pdf.json +++ b/pdf-service/format-config/witness-warrant-pdf.json @@ -58,6 +58,103 @@ "style": "next-hearing-date", "layout": "noBorders" }, + { + "style": "party-table", + "table": { + "widths": ["30%", "70%"], + "body": [ + "{{#complainantList}}", + [ + { + "text": "Complainant {{index}}", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{name}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + [ + { + "text": "Advocate(s)", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{listOfAdvocatesRepresenting}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + "{{/complainantList}}", + [ + { + "text": "", + "style": "party-cell", + "border": [true, false, false, false] + }, + { + "text": "", + "style": "party-cell", + "border": [false, false, true, false] + } + ], + "{{#accusedList}}", + [ + { + "text": "Accused {{index}}", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{name}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + [ + { + "text": "Advocate(s)", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "{{listOfAdvocatesRepresenting}}", + "style": "party-cell", + "border": [true, true, true, true] + } + ], + "{{/accusedList}}", + [ + { + "text": "", + "style": "party-cell", + "border": [true, false, false, false] + }, + { + "text": "", + "style": "party-cell", + "border": [false, false, true, false] + } + ], + [ + { + "text": "Offence", + "style": "party-cell", + "border": [true, true, true, true] + }, + { + "text": "S.138 of the Negotiable Instruments Act, 1881", + "style": "party-cell", + "border": [true, true, true, true] + } + ] + ] + }, + "margin": [0, 10, 0, 10] + }, { "style": "form-body", "table": { @@ -75,7 +172,7 @@ { "text": [ { - "text": "Whereas complaint has been made before me that {{respondentName}} of {{respondentAddress}} has (or is suspected to have) committed the offence U/s. 138 of Negotiable Instruments Act, and it appears likely that {{respondentName}} can give evidence concerning the said complaint, and whereas I have good and sufficient reason to believe that he will not attend as a witness on the hearing of the said complaint unless compelled to do so;" + "text": "In the above mentioned case, involving the above listed parties, it appears to me that {{witnessName}} is likely to give material evidence or to produce any document or other thing, and whereas I have good and sufficient reason to believe that he will not attend as a witness on the hearing of the said complaint unless compelled to do so;" } ], "style": "form-sub-body" @@ -83,7 +180,7 @@ ], [ { - "text": "This is to authorise and require you to arrest {{respondentName}}, and on the {{hearingDate}} to bring him before the Special Court of Judicial Magistrate of the First Class, for the trial of cases under section 138 of Negotiable Instruments Act, 1881 at Kollam (‘24x7 ON Courts’) to be examined touching the offence complained of.", + "text": "This is to authorise and require you to arrest {{witnessName}} of {{respondentAddress}}, and on the {{hearingDate}} to bring him before the Special Court of Judicial Magistrate of the First Class, for the trial of cases under section 138 of Negotiable Instruments Act, 1881 at Kollam (‘24x7 ON Courts’) to be examined touching the offence complained of.", "style": "form-sub-body" } ] @@ -141,6 +238,15 @@ "alignment": "right", "margin": [0, 0, 0, 10] }, + "party-table": { + "fontSize": 12, + "color": "#484848" + }, + "party-cell": { + "fontSize": 12, + "color": "#484848", + "margin": [2, 5, 2, 5] + }, "tl-head": { "fillColor": "white", "margin": [ From cd9ef3285dded9a50830473239150ccdb3669521 Mon Sep 17 00:00:00 2001 From: TusharKatiyar2002 Date: Thu, 16 Jul 2026 12:21:55 +0530 Subject: [PATCH 3/3] changed font size and spacing in warrant to witness pdf --- .../format-config/witness-warrant-pdf.json | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pdf-service/format-config/witness-warrant-pdf.json b/pdf-service/format-config/witness-warrant-pdf.json index f04365fc..19d11c08 100644 --- a/pdf-service/format-config/witness-warrant-pdf.json +++ b/pdf-service/format-config/witness-warrant-pdf.json @@ -43,9 +43,9 @@ "alignment": "center", "margin": [ 0, - 20, + 10, 0, - 20 + 10 ] } ] @@ -92,12 +92,12 @@ [ { "text": "", - "style": "party-cell", + "style": "empty-party-cell", "border": [true, false, false, false] }, { "text": "", - "style": "party-cell", + "style": "empty-party-cell", "border": [false, false, true, false] } ], @@ -130,12 +130,12 @@ [ { "text": "", - "style": "party-cell", + "style": "empty-party-cell", "border": [true, false, false, false] }, { "text": "", - "style": "party-cell", + "style": "empty-party-cell", "border": [false, false, true, false] } ], @@ -189,9 +189,9 @@ "layout": "noBorders", "margin": [ 0, - 20, + 15, 0, - 20 + 15 ] }, { @@ -224,7 +224,7 @@ "layout": "noBorders", "margin": [ 0, - 20, + 10, 0, 0 ] @@ -243,9 +243,14 @@ "color": "#484848" }, "party-cell": { - "fontSize": 12, + "fontSize": 10, + "color": "#484848", + "margin": [0, 2, 0, 2] + }, + "empty-party-cell": { + "fontSize": 5, "color": "#484848", - "margin": [2, 5, 2, 5] + "margin": [0, 0, 0, 0] }, "tl-head": { "fillColor": "white", @@ -317,7 +322,7 @@ 0, 30, 0, - 20 + 0 ], "bold": true, "color": "#000000",