libraries폴더에 tcpdf폴더 생성하고 복사.
Pdf_Library.php 생성. tcpdf 연결 및 Library생성
require_once dirname(__file__).'/tcpdf/tcpdf.php';
class PDF_library extends TCPDF{
public function __construct(){
parent::__construct();
}
}
Controllers 에서 PDF_library 로드하여 사용.
# 한글폰트 추가
tcpdf폴더 하위의 tools폴더의 tcpdf_addfont.php를 이용하여 폰트 추가
php tcpdf_addfont.php -i "폰트경로 및 파일명"
tcpdf폴더의 fonts폴더에 폰트들이 추가됨.
설정 추가
/tdpdf/config/tcpdf_config.php -> 기본설정 정보(여백, 타이틀, 용지 등등)
파일명 한글로 저장.
tcpdf.php
7581줄 public function Output($name='doc.pdf', $dest='I'){} 함수에서
$name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name);
->
$name = preg_replace('/[^가-힣\x20^a-zA-Z0-9_\.-]/', '', $name);
변경.
영문 숫자 이외의 문자는 모두 지움으로 되어있음.
'프로그래밍 > PHP CI' 카테고리의 다른 글
codeigniter-restserver을 이용한 REST server 구축 (0) | 2020.05.22 |
---|---|
mPdf사용기 (0) | 2020.03.03 |
IIS에서 Codeigniter 설정 (0) | 2020.01.06 |