Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy to use PHP PDF library with unicode support?

I tried dompdf. It's a lot easier to use than other libraries I've tried but it doesn't have unicode support. Or rather, it has unicode support but requires another library called PDFLib ($1k version).

So I am just wondering if anybody has ever stumbled upon or used any PHP pdf library which is both easy to use and has unicode support.

like image 444
sodhancha Avatar asked Oct 15 '22 06:10

sodhancha


2 Answers

I think fpdf supports that.

like image 178
Sarfraz Avatar answered Oct 27 '22 17:10

Sarfraz


You can use TCPDF:
http://www.tcpdf.org/examples/example_008.pdf
http://www.tcpdf.org/examples/example_018.pdf

or you can use html2pdf - it's using tcpdf at its core but it's made to particularly convert html to pdf (css..): Html2pdf
http://demo.html2pdf.fr/examples/pdf/utf8.pdf

and last but not least: mpdf http://www.mpdf1.com/mpdf/index.php

maight be fastest and make smallest pdf in size ( then other two ). also has font_autodetect to detect and use unicode fonts.

like image 40
phpJs Avatar answered Oct 27 '22 16:10

phpJs