开发者

PHP: How to render PDF reports containing charts?

I want to create PDF reports containing some pie/bar charts. I have to create them with my PHP web app and cannot use commandline tools. For the frontend I use flot. However, I don't know how to get these charts in a PDF, because my project is constrained to PHP.

How do I generate images from my charts to render a PDF?

Update: The solution has to be open source since my开发者_JAVA技巧 project will be open source, too.

Best,

Stefan


Of course you won't be able to use a javascript charting solution to generate graphics to be used directly in a PDF. What you could do however, is use a PHP charting solution to create the graphs. Provided you have GD support built-in (it usually is) you could use pChart or libChart to create GIF/PNG charts you can embed within your PDF.

And for PDF generation I would personally recommend using TCPDF.


Can you use PDFLib ?

http://php.net/manual/en/ref.pdf.php

http://www.pdflib.com/pdflib-cookbook/graphics/fill-pattern/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜