From 27790861c202ee091241591f78dc6f2349987a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 6 Mar 2026 10:08:55 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[approvals]=20=EC=9C=84=EC=B4=89?= =?UTF-8?q?=EC=A6=9D=EB=AA=85=EC=84=9C=20=EC=9D=B8=EC=87=84/PDF=20A4=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20=EC=88=98=EC=A7=81=20?= =?UTF-8?q?=EB=B0=B0=EB=B6=84=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 인쇄 CSS: @page A4 적용, 상단 padding 100px로 확대 - HTML 미리보기: 제목/테이블/증명문구/날짜/서명 간격 확대 - PDF: 상단 여백 및 섹션 간 Ln 값 증가 (A4 수직 균등 배분) --- app/Services/AppointmentCertService.php | 13 ++++++++----- resources/views/approvals/create.blade.php | 16 ++++++++-------- resources/views/approvals/show.blade.php | 16 ++++++++-------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/app/Services/AppointmentCertService.php b/app/Services/AppointmentCertService.php index 427f8cca..f332316b 100644 --- a/app/Services/AppointmentCertService.php +++ b/app/Services/AppointmentCertService.php @@ -78,17 +78,20 @@ public function generatePdfResponse(array $content): \Illuminate\Http\Response $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); - $pdf->SetMargins(20, 20, 20); + $pdf->SetMargins(20, 40, 20); $pdf->SetAutoPageBreak(true, 20); $font = $this->getKoreanFont(); $pdf->AddPage(); + // 상단 여백 + $pdf->Ln(20); + // 제목 $pdf->SetFont($font, 'B', 22); $pdf->Cell(0, 20, '위 촉 증 명 서', 0, 1, 'C'); - $pdf->Ln(8); + $pdf->Ln(20); $pageWidth = $pdf->getPageWidth() - 40; $thWidth = 30; @@ -119,19 +122,19 @@ public function generatePdfResponse(array $content): \Illuminate\Http\Response $this->addTableRow($pdf, $font, [ ['용 도', $content['purpose'] ?? '-', 0], ]); - $pdf->Ln(12); + $pdf->Ln(30); // 증명 문구 $pdf->SetFont($font, '', 12); $pdf->Cell(0, 10, '위와 같이 위촉하였음을 증명합니다.', 0, 1, 'C'); - $pdf->Ln(6); + $pdf->Ln(20); // 발급일 $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->Ln(30); // 회사명 + 대표이사 $ceoName = $content['ceo_name'] ?? ''; diff --git a/resources/views/approvals/create.blade.php b/resources/views/approvals/create.blade.php index 8be7c080..40043715 100644 --- a/resources/views/approvals/create.blade.php +++ b/resources/views/approvals/create.blade.php @@ -1282,10 +1282,10 @@ function printAppointmentCertPreview() { const content = document.getElementById('appointment-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(); }; } @@ -1296,9 +1296,9 @@ function buildAppointmentCertPreviewHtml(d) { const tdStyle = 'border:1px solid #333; padding:10px 14px; font-size:14px;'; return ` -

위 촉 증 명 서

+

위 촉 증 명 서

- +
@@ -1325,15 +1325,15 @@ function buildAppointmentCertPreviewHtml(d) {
성 명 ${e(d.name)}
-

+

위와 같이 위촉하였음을 증명합니다.

-

+

${e(d.issueDateFormatted)}

-
+

${e(d.company)}

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

diff --git a/resources/views/approvals/show.blade.php b/resources/views/approvals/show.blade.php index 6a02788b..2ff6ca8f 100644 --- a/resources/views/approvals/show.blade.php +++ b/resources/views/approvals/show.blade.php @@ -599,10 +599,10 @@ function printAppointmentCertShowPreview() { const content = document.getElementById('appointment-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(); }; } @@ -613,17 +613,17 @@ function _buildAppointmentCertHtml(d) { const tdStyle = 'border:1px solid #333; padding:10px 14px; font-size:14px;'; return ` -

위 촉 증 명 서

- +

위 촉 증 명 서

+
성 명${e(d.name)}
주민등록번호${e(d.resident)}
소 속${e(d.department)}연 락 처${e(d.phone)}
위촉(재직)기간${e(d.hireDate)} ~ ${e(d.resignDate)}계약자격${e(d.contractType)}
용 도${e(d.purpose)}
-

위와 같이 위촉하였음을 증명합니다.

-

${e(d.issueDateFormatted)}

-
+

위와 같이 위촉하였음을 증명합니다.

+

${e(d.issueDateFormatted)}

+

${e(d.company)}

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