how to generate pdf file form utf-8 mysql data
hey guys i searched a lot but there is a little topics discussed about generating pdf file in php ( using utf-8 f开发者_开发技巧ormat ) . my target language is Persian ( Arabic format ) and im wondering what is the best way to generate a clear cut and working pdf files out of my mysql/php scripts .
when im trying to use FPDF no satisfying result comes out , the pdf generated with this script looks terrible and unreadable .
Persian is a mufti byte language exactly like Arabic ( actually with more alphabetic words )
thanks everyone tried to help me , just answering this question to end this topic
i found the solution by using this block of code ,
by using this script u can happily export ur datas to utf-8 ( Persian ) PDF files
http://www.tcpdf.org/examples/example_018.phps
Have you tried TCPDF?
I would suggest that you look at itextsharp which is a is a port of the iText open source java library. A great library for pdf generation.
Can be dowloaded from sourceforge.net.
Regards and happy coding
There are a number of things you can do
If you have firefox running on your server, you can install a plugin which will create a PDF via the commandline.
You can install the php library called html2ps and then covert ps2pdf. So basically you create a web page which will look exactly like the pdf file you want to create and run html2ps on it. Almost all css tags are supported.
The second option has worked well for most of our projects.
For example the Zend Framework supports to create PDFs -> http://framework.zend.com/manual/en/zend.pdf.html
You can also use FOP Processing to generate PDF. For that you have to call Apache FOP with exec() or shell_exec().
精彩评论