Posts Tagged ‘pdf unicode Vietnamese’
Codeigniter pdf libraries (php export pdf Unicode/UTF8 – Vietnamese)
19/07/2011
2 comments
Thêm mPDF libraries cho Codeigniter Framework, xuất file pdf Tiếng Việt có dấu (pdf Unicode/utf8)
Step 1: Download mPDF tại địa chỉ URL: http://www.mpdf1.com/mpdf/download
Step 2: Giải nén (uncompress) thư viện mPDF vào thư mục libraries của Codeigniter như sau:
your_project/system/application/libraries/mpdf/ (uncompress mpdf)
Step 3: Tạo file để gọi các lớp trong thư viện mpdf như sau:
Sau đó lưu (Save) tại đường dẫn sau:
your_project/system/application/libraries/Mpdf.php
Step 4: Sử dụng
$html = "Cho ví dụ minh họa"; $this->load->library('Mpdf'); $mpdf = new Pdf(); $mpdf->useAdobeCJK = true; $mpdf->SetAutoFont(AUTOFONT_ALL); $mpdf->WriteHTML($html); $save_file = $dir_bill.$filename.'.pdf'; $mpdf->Output(); //Neu xuat ra file $mpdf->Output('dir/ten_file_pdf', 'F');
nhantam
PHP Developer
Chuyên Thiết kế web bán hàng
Categories: Codeigniter, PHP
pdf unicode Vietnamese