开发者

Generate a UTF-8-pdf from a PHP website

I'm trying to code a website in CakePHP where people fill in their details to apply for our开发者_开发问答 university.

This is in Germany, and we have a lot of applicants, so we have names with Czech accents, German umlauts, etc.

They enter their data in a form which gets saved in a database (also in UTF-8). The site should also generate a .pdf with their name, address etc. I tried using FPDF and the unicode extension UFPDF, but somehow still fail.

Now I'm wondering if I can somehow generate a LaTeX-document and just automatically enter the user's data and compile & return it to the user. LaTeX always worked fine for me with UTF-8.

Oh, I forgot: I don't want to use TCPDF (which apparently supports UTF-8), because it already took 20secs for a Hello-World-document; I'm scared it would strangle the server when 300 students apply at the same time.

If anyone could help me, I would be very thankful.


You could do it the LaTeX way, calling exec from PHP and creating the document.

Or you can use TCPDF which is build on FPDF but it has more functionality build in it, and it supports UTF-8.

Hm 20sec for a simple document seems very very long, I've created larger documents with many pictures (20+ pages with 3 images each page) with TCPDF and it's usually very fast, far from 20 sec even for documents of that size.


Did you ever try PDFLIB?

The company is located in your country, the product is really very professional. When we used it for a project we never had any problems with unicode support. (I assume the direct PDF generation this way is way faster and less error-prone than executing tex).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜