From 70ef10e201df7344e5d7ec7e9de939e44667109d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Thu, 26 Feb 2026 14:59:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:TCPDF=20=ED=8F=B0=ED=8A=B8=20=EC=BA=90?= =?UTF-8?q?=EC=8B=9C=20=EA=B2=BD=EB=A1=9C=EB=A5=BC=20storage=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(vendor=20=EC=93=B0=EA=B8=B0=20=EA=B6=8C?= =?UTF-8?q?=ED=95=9C=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - getKoreanFont()에서 폰트 캐시를 vendor/tcpdf/fonts/ 대신 storage/app/private/fonts/에 저장 - www-data가 vendor 디렉토리에 쓸 수 없는 운영 환경 권한 문제 해결 - 배포 시마다 vendor가 새로 생성되어도 폰트 캐시가 shared/storage에 유지됨 --- app/Services/ESign/PdfSignatureService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Services/ESign/PdfSignatureService.php b/app/Services/ESign/PdfSignatureService.php index ccd00d5f..5116b2fd 100644 --- a/app/Services/ESign/PdfSignatureService.php +++ b/app/Services/ESign/PdfSignatureService.php @@ -23,7 +23,12 @@ private function getKoreanFont(): string $fontPath = '/usr/share/fonts/truetype/nanum/NanumGothic.ttf'; if (file_exists($fontPath)) { - $this->koreanFontName = \TCPDF_FONTS::addTTFfont($fontPath, 'TrueTypeUnicode', '', 96); + // 폰트 캐시를 storage에 저장 (vendor 디렉토리 쓰기 권한 문제 방지) + $fontCacheDir = storage_path('app/private/fonts'); + if (! is_dir($fontCacheDir)) { + mkdir($fontCacheDir, 0775, true); + } + $this->koreanFontName = \TCPDF_FONTS::addTTFfont($fontPath, 'TrueTypeUnicode', '', 96, $fontCacheDir.'/'); } return $this->koreanFontName ?: 'helvetica';