From 93db5c982abe9575805b837e134b8219275cf3a4 Mon Sep 17 00:00:00 2001 From: harid Date: Fri, 14 Nov 2025 21:25:11 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20padding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/ExamReportController.cs | 34 ++++++++++++++------------ Controllers/RecruitReportController.cs | 32 ++++++++++++------------ 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs index 5d793fa..629aa63 100644 --- a/Controllers/ExamReportController.cs +++ b/Controllers/ExamReportController.cs @@ -738,6 +738,7 @@ namespace BMA.EHR.Report.Service.Controllers // Title var title = new Paragraph($"รายชื่อผู้มีสิทธิ์สอบ\n{examName ?? ""}") .SetBold() + .SetMultipliedLeading(0.9f) .SetTextAlignment(TextAlignment.CENTER); document.Add(title); @@ -747,10 +748,9 @@ namespace BMA.EHR.Report.Service.Controllers { // Group Header (ตำแหน่ง) Paragraph positionHeader = new Paragraph($"{group.PositionName} {group.Total}") - .SetTextAlignment(TextAlignment.CENTER) .SetBold() - .SetFontSize(15) - .SetMarginBottom(10); + .SetMultipliedLeading(0.9f) + .SetTextAlignment(TextAlignment.CENTER); document.Add(positionHeader); @@ -761,19 +761,20 @@ namespace BMA.EHR.Report.Service.Controllers string[] headers = { "ลำดับที่", "เลขประจำตัวสอบ", "ชื่อ-สกุล", "หมายเหตุ" }; foreach (var h in headers) { - table.AddHeaderCell(new Cell().Add(new Paragraph(h)).SetTextAlignment(TextAlignment.CENTER).SetBold()); + table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f)) + .SetBold() + .SetTextAlignment(TextAlignment.CENTER)); } // Table Details foreach (var x in group.Persons) { - table.AddCell(new Cell().Add(new Paragraph(x.No)).SetTextAlignment(TextAlignment.CENTER)); - table.AddCell(new Cell().Add(new Paragraph(x.ExamId)).SetTextAlignment(TextAlignment.CENTER)); - table.AddCell(new Cell().Add(new Paragraph(x.FullName)).SetTextAlignment(TextAlignment.LEFT)); - table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "")).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.No).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.ExamId).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT)); + table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "").SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); } document.Add(table); - // เว้นระหว่าง groups document.Add(new Paragraph("\n")); } } @@ -864,6 +865,7 @@ namespace BMA.EHR.Report.Service.Controllers var title = new Paragraph($"รายชื่อผู้สอบแข่งขันได้\n{examName}") .SetBold() + .SetMultipliedLeading(0.9f) .SetTextAlignment(TextAlignment.CENTER); document.Add(title); @@ -872,10 +874,10 @@ namespace BMA.EHR.Report.Service.Controllers { // Header per group Paragraph positionHeader = new Paragraph($"{g.PositionName} {g.Total}") - .SetTextAlignment(TextAlignment.CENTER) .SetBold() - .SetFontSize(15) - .SetMarginBottom(10); + .SetMultipliedLeading(0.9f) + .SetTextAlignment(TextAlignment.CENTER); + document.Add(positionHeader); @@ -885,17 +887,17 @@ namespace BMA.EHR.Report.Service.Controllers string[] headers = { "ลำดับที่", "สนามสอบ", "ชื่อ - นามสกุล", "คะแนนสอบ" }; foreach (var h in headers) { - table.AddHeaderCell(new Cell().Add(new Paragraph(h)) + table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f)) .SetTextAlignment(TextAlignment.CENTER) .SetBold()); } foreach (var p in g.Persons) { - table.AddCell(new Cell().Add(new Paragraph(p.Number)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(p.Number).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); table.AddCell(new Cell()); - table.AddCell(new Cell().Add(new Paragraph(p.FullName)).SetTextAlignment(TextAlignment.LEFT)); - table.AddCell(new Cell().Add(new Paragraph(p.SumScore)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(p.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT)); + table.AddCell(new Cell().Add(new Paragraph(p.SumScore).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); } document.Add(table); diff --git a/Controllers/RecruitReportController.cs b/Controllers/RecruitReportController.cs index 0cf6ca6..1afe0be 100644 --- a/Controllers/RecruitReportController.cs +++ b/Controllers/RecruitReportController.cs @@ -406,6 +406,7 @@ namespace BMA.EHR.Report.Service.Controllers $"รายชื่อผู้ชำระค่าธรรมเนียมการสมัครสอบการแข่งขันเพื่อบรรจุและแต่งตั้งบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ {examName ?? ""}" ) .SetBold() + .SetMultipliedLeading(0.9f) .SetTextAlignment(TextAlignment.CENTER); document.Add(title); @@ -415,10 +416,9 @@ namespace BMA.EHR.Report.Service.Controllers { // Group Header (ตำแหน่ง) Paragraph positionHeader = new Paragraph($"{group.PositionName} {group.Total}") - .SetTextAlignment(TextAlignment.CENTER) .SetBold() - .SetFontSize(15) - .SetMarginBottom(10); + .SetMultipliedLeading(0.9f) + .SetTextAlignment(TextAlignment.CENTER); document.Add(positionHeader); @@ -429,16 +429,18 @@ namespace BMA.EHR.Report.Service.Controllers string[] headers = { "ลำดับที่", "เลขประจำตัวสอบ", "ชื่อ-สกุล", "หมายเหตุ" }; foreach (var h in headers) { - table.AddHeaderCell(new Cell().Add(new Paragraph(h)).SetTextAlignment(TextAlignment.CENTER).SetBold()); + table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f)) + .SetBold() + .SetTextAlignment(TextAlignment.CENTER)); } // Table Details foreach (var x in group.Persons) { - table.AddCell(new Cell().Add(new Paragraph(x.No)).SetTextAlignment(TextAlignment.CENTER)); - table.AddCell(new Cell().Add(new Paragraph(x.ExamId)).SetTextAlignment(TextAlignment.CENTER)); - table.AddCell(new Cell().Add(new Paragraph(x.FullName)).SetTextAlignment(TextAlignment.LEFT)); - table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "")).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.No).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.ExamId).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT)); + table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "").SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); } document.Add(table); // เว้นระหว่าง groups @@ -605,6 +607,7 @@ namespace BMA.EHR.Report.Service.Controllers document.SetMargins(30, 15, 20, 15); var title = new Paragraph($"รายชื่อผู้สอบแข่งขันได้\n{examName}") + .SetMultipliedLeading(0.9f) .SetBold() .SetTextAlignment(TextAlignment.CENTER); @@ -614,10 +617,9 @@ namespace BMA.EHR.Report.Service.Controllers { // Header per group Paragraph positionHeader = new Paragraph($"{g.PositionName} {g.Total}") + .SetMultipliedLeading(0.9f) .SetTextAlignment(TextAlignment.CENTER) - .SetBold() - .SetFontSize(15) - .SetMarginBottom(10); + .SetBold(); document.Add(positionHeader); @@ -627,17 +629,17 @@ namespace BMA.EHR.Report.Service.Controllers string[] headers = { "ลำดับที่", "สนามสอบ", "ชื่อ - นามสกุล", "คะแนนสอบ" }; foreach (var h in headers) { - table.AddHeaderCell(new Cell().Add(new Paragraph(h)) + table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f)) .SetTextAlignment(TextAlignment.CENTER) .SetBold()); } foreach (var p in g.Persons) { - table.AddCell(new Cell().Add(new Paragraph(p.Number)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(p.Number).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); table.AddCell(new Cell()); - table.AddCell(new Cell().Add(new Paragraph(p.FullName)).SetTextAlignment(TextAlignment.LEFT)); - table.AddCell(new Cell().Add(new Paragraph(p.SumScore)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(p.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT)); + table.AddCell(new Cell().Add(new Paragraph(p.SumScore).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); } document.Add(table);