问题
I'm using the PHPExcel library in a couple of project and love the functionality it provides. Currently I needed to save as a PDF and found that PHPExcel can do this but I'm finding it rather hard to track down some examples or documentation on the process.
Here are the links I have found:
- http://phpexcel.codeplex.com/wikipage?title=News%20archive
- http://www.devshed.com/c/a/PHP/PHP-Excel-Working-with-Workbook-and-PDF-Files/1/
Follow up question:
I need the PDF to look and function as a form, the ability to prefill data fields, and select different options. Would PHPExcel be the right choice for this? Currently I'm using pdftk on the command line and changing servers has caused the problem of needing to downgrade the version to an older one. This is fine but I think I'm looking to replace this and go with a PHP based approach.
Thoughts? Suggestions?
回答1:
PHPExcel uses the tcpdf library to render the PDF. If you look at the appropriate source code, you'll see it doesn't allow external access to the PDF object it creates. tcpdf does support form elements, so it appears your solution is to write your own Writer class for PHPExcel or just modify that code so you can get the results you're looking for.
来源:https://stackoverflow.com/questions/7678566/phpexcel-create-style-save-pdf-documentation