Farshad
Farshad

Reputation: 1015

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 format ) . 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 )

Upvotes: 1

Views: 3734

Answers (5)

Farshad
Farshad

Reputation: 1015

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

Upvotes: 2

DrDol
DrDol

Reputation: 2240

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().

Upvotes: 0

Sudhanshu
Sudhanshu

Reputation: 6893

There are a number of things you can do

  1. If you have firefox running on your server, you can install a plugin which will create a PDF via the commandline.

  2. 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.

Upvotes: 0

Muleskinner
Muleskinner

Reputation: 14468

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

Upvotes: 0

echo
echo

Reputation: 7855

Have you tried TCPDF?

Upvotes: 1

Related Questions