How to view/convert uploaded file in/to pdf?
i am building a simple system u开发者_StackOverflow社区sing PHP that allow people to Add, Delete, and View data. Can anyone tell me how to view the uploaded data in PDF format?
There are a bunch of options. The ones I like are:
wkhtml2pdf - A command-line tool that uses the WebKit HTML rendering engine to generate PDFs from HTML docs. Very easy to use, assuming you're able to get it installed on your server, and your requirements aren't too stringent. You just generate HTML/CSS, and use PHP's shell-exec functions to run it, and voila.
Zend_Pdf - Part of the Zend Framework, but like almost all ZF components, you can use it stand-alone. Programmatically build PDFs.
tcpdf, fpdf (with fpdi if you want to import existing PDFs and write over the top of them) - older, uglier, but effective.
There's also the commercial PDFLib, which used to be the best thing around, but I don't remember much about it. Included for approximate completeness.
Take a look at PDFLib, or its deprecated predecessor.
精彩评论