diff --git a/app/Services/EmploymentCertService.php b/app/Services/EmploymentCertService.php index 06e66b21..70733672 100644 --- a/app/Services/EmploymentCertService.php +++ b/app/Services/EmploymentCertService.php @@ -76,21 +76,24 @@ public function generatePdfResponse(array $content): \Illuminate\Http\Response $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); - $pdf->SetMargins(20, 20, 20); + $pdf->SetMargins(20, 30, 20); $pdf->SetAutoPageBreak(true, 20); $font = $this->getKoreanFont(); $pdf->AddPage(); + // 상단 여백 + $pdf->Ln(10); + // 제목 - $pdf->SetFont($font, 'B', 22); + $pdf->SetFont($font, 'B', 24); $pdf->Cell(0, 20, '재 직 증 명 서', 0, 1, 'C'); - $pdf->Ln(8); + $pdf->Ln(12); // === 1. 인적사항 === - $pdf->SetFont($font, 'B', 12); - $pdf->Cell(0, 8, '1. 인적사항', 0, 1, 'L'); + $pdf->SetFont($font, 'B', 13); + $pdf->Cell(0, 10, '1. 인적사항', 0, 1, 'L'); $pdf->Ln(2); $this->addTableRow($pdf, $font, [ @@ -100,11 +103,11 @@ public function generatePdfResponse(array $content): \Illuminate\Http\Response $this->addTableRow($pdf, $font, [ ['주 소', $content['address'] ?? '-', 0], ]); - $pdf->Ln(6); + $pdf->Ln(8); // === 2. 재직사항 === - $pdf->SetFont($font, 'B', 12); - $pdf->Cell(0, 8, '2. 재직사항', 0, 1, 'L'); + $pdf->SetFont($font, 'B', 13); + $pdf->Cell(0, 10, '2. 재직사항', 0, 1, 'L'); $pdf->Ln(2); $this->addTableRow($pdf, $font, [ @@ -123,34 +126,34 @@ public function generatePdfResponse(array $content): \Illuminate\Http\Response $this->addTableRow($pdf, $font, [ ['재직기간', $hireDateDisplay, 0], ]); - $pdf->Ln(6); + $pdf->Ln(8); // === 3. 발급정보 === - $pdf->SetFont($font, 'B', 12); - $pdf->Cell(0, 8, '3. 발급정보', 0, 1, 'L'); + $pdf->SetFont($font, 'B', 13); + $pdf->Cell(0, 10, '3. 발급정보', 0, 1, 'L'); $pdf->Ln(2); $this->addTableRow($pdf, $font, [ ['사용용도', $content['purpose'] ?? '-', 0], ]); - $pdf->Ln(12); + $pdf->Ln(20); // 증명 문구 - $pdf->SetFont($font, '', 12); - $pdf->Cell(0, 10, '위 사항을 증명합니다.', 0, 1, 'C'); - $pdf->Ln(6); + $pdf->SetFont($font, '', 14); + $pdf->Cell(0, 12, '위 사항을 증명합니다.', 0, 1, 'C'); + $pdf->Ln(10); // 발급일 $issueDate = $content['issue_date'] ?? date('Y-m-d'); $issueDateFormatted = $this->formatDate($issueDate); - $pdf->SetFont($font, 'B', 12); - $pdf->Cell(0, 10, $issueDateFormatted, 0, 1, 'C'); - $pdf->Ln(12); + $pdf->SetFont($font, 'B', 14); + $pdf->Cell(0, 12, $issueDateFormatted, 0, 1, 'C'); + $pdf->Ln(20); // 회사명 + 대표이사 $ceoName = $content['ceo_name'] ?? ''; - $pdf->SetFont($font, 'B', 14); - $pdf->Cell(0, 10, ($content['company_name'] ?? '').' 대표이사 '.$ceoName.' (인)', 0, 1, 'C'); + $pdf->SetFont($font, 'B', 16); + $pdf->Cell(0, 12, ($content['company_name'] ?? '').' 대표이사 '.$ceoName.' (인)', 0, 1, 'C'); $pdfContent = $pdf->Output('', 'S'); $fileName = '재직증명서_'.($content['name'] ?? '').'.pdf'; @@ -167,24 +170,24 @@ public function generatePdfResponse(array $content): \Illuminate\Http\Response private function addTableRow(\TCPDF $pdf, string $font, array $cells): void { $pageWidth = $pdf->getPageWidth() - 40; // margins - $rowHeight = 8; + $rowHeight = 10; $thWidth = 30; if (count($cells) === 1) { // 단일 셀: th + td (전체 너비) - $pdf->SetFont($font, 'B', 10); + $pdf->SetFont($font, 'B', 11); $pdf->SetFillColor(248, 249, 250); $pdf->Cell($thWidth, $rowHeight, $cells[0][0], 1, 0, 'L', true); - $pdf->SetFont($font, '', 10); + $pdf->SetFont($font, '', 11); $pdf->Cell($pageWidth - $thWidth, $rowHeight, $cells[0][1], 1, 1, 'L'); } else { // 복수 셀: th+td + th+td $tdWidth = ($pageWidth - $thWidth * 2) / 2; foreach ($cells as $cell) { - $pdf->SetFont($font, 'B', 10); + $pdf->SetFont($font, 'B', 11); $pdf->SetFillColor(248, 249, 250); $pdf->Cell($thWidth, $rowHeight, $cell[0], 1, 0, 'L', true); - $pdf->SetFont($font, '', 10); + $pdf->SetFont($font, '', 11); $pdf->Cell($tdWidth, $rowHeight, $cell[1], 1, 0, 'L'); } $pdf->Ln(); diff --git a/resources/views/approvals/create.blade.php b/resources/views/approvals/create.blade.php index f562247b..fff86c0a 100644 --- a/resources/views/approvals/create.blade.php +++ b/resources/views/approvals/create.blade.php @@ -1017,10 +1017,10 @@ function printCertPreview() { const content = document.getElementById('cert-preview-content').innerHTML; const win = window.open('', '_blank', 'width=800,height=1000'); win.document.write('재직증명서'); - win.document.write(''); - win.document.write(''); + win.document.write(''); + win.document.write('
'); win.document.write(content); - win.document.write(''); + win.document.write('
'); win.document.close(); win.onload = function() { win.print(); }; } @@ -1486,14 +1486,14 @@ function buildResignationPreviewHtml(d) { function buildCertPreviewHtml(d) { const e = (s) => { const div = document.createElement('div'); div.textContent = s; return div.innerHTML; }; - const thStyle = 'border:1px solid #333; padding:10px 14px; background:#f8f9fa; font-weight:600; text-align:left; white-space:nowrap; width:120px; font-size:14px;'; - const tdStyle = 'border:1px solid #333; padding:10px 14px; font-size:14px;'; + const thStyle = 'border:1px solid #333; padding:14px 16px; background:#f8f9fa; font-weight:600; text-align:left; white-space:nowrap; width:130px; font-size:15px;'; + const tdStyle = 'border:1px solid #333; padding:14px 16px; font-size:15px;'; return ` -

재 직 증 명 서

+

재 직 증 명 서

-

1. 인적사항

- +

1. 인적사항

+
@@ -1506,8 +1506,8 @@ function buildCertPreviewHtml(d) {
성 명 ${e(d.name)}
-

2. 재직사항

- +

2. 재직사항

+
@@ -1528,25 +1528,25 @@ function buildCertPreviewHtml(d) {
회 사 명 ${e(d.company)}
-

3. 발급정보

- +

3. 발급정보

+
사용용도 ${e(d.purpose)}
-

+

위 사항을 증명합니다.

-

+

${e(d.issueDateFormatted)}

-
-

${e(d.company)}

-

대표이사    ${e(d.ceoName)}    (인)

+
+

${e(d.company)}

+

대표이사    ${e(d.ceoName)}    (인)

`; } diff --git a/resources/views/approvals/show.blade.php b/resources/views/approvals/show.blade.php index edea7199..ede75f4f 100644 --- a/resources/views/approvals/show.blade.php +++ b/resources/views/approvals/show.blade.php @@ -750,42 +750,42 @@ function printCertShowPreview() { const content = document.getElementById('cert-show-preview-content').innerHTML; const win = window.open('', '_blank', 'width=800,height=1000'); win.document.write('재직증명서'); - win.document.write(''); - win.document.write(''); + win.document.write(''); + win.document.write('
'); win.document.write(content); - win.document.write(''); + win.document.write('
'); win.document.close(); win.onload = function() { win.print(); }; } function _buildCertHtml(d) { const e = (s) => { const div = document.createElement('div'); div.textContent = s; return div.innerHTML; }; - const thStyle = 'border:1px solid #333; padding:10px 14px; background:#f8f9fa; font-weight:600; text-align:left; white-space:nowrap; width:120px; font-size:14px;'; - const tdStyle = 'border:1px solid #333; padding:10px 14px; font-size:14px;'; + const thStyle = 'border:1px solid #333; padding:14px 16px; background:#f8f9fa; font-weight:600; text-align:left; white-space:nowrap; width:130px; font-size:15px;'; + const tdStyle = 'border:1px solid #333; padding:14px 16px; font-size:15px;'; return ` -

재 직 증 명 서

-

1. 인적사항

- +

재 직 증 명 서

+

1. 인적사항

+
성 명${e(d.name)}주민등록번호${e(d.resident)}
주 소${e(d.address)}
-

2. 재직사항

- +

2. 재직사항

+
회 사 명${e(d.company)}
사업자번호${e(d.businessNum)}
근무부서${e(d.department)}직 급${e(d.position)}
재직기간${e(d.hireDate)}
-

3. 발급정보

- +

3. 발급정보

+
사용용도${e(d.purpose)}
-

위 사항을 증명합니다.

-

${e(d.issueDateFormatted)}

-
-

${e(d.company)}

-

대표이사    ${e(d.ceoName)}    (인)

+

위 사항을 증명합니다.

+

${e(d.issueDateFormatted)}

+
+

${e(d.company)}

+

대표이사    ${e(d.ceoName)}    (인)

`; }