Generate PDF file with Zend Framework 2 [closed]

≯℡__Kan透↙ 提交于 2019-12-22 09:39:26

问题


I'm started to learn ZF2 right now and notice that there's no "Zend_Pdf" or similar on zend framework 2...

How can I create pdf on this version of the framework?

Anyone knows a good tutorial?


回答1:


Zend Framework 2 has moved many of the old Zend Framework libraries out of the main core and created modules instead. Zend_Pdf is one of the libraries that was moved to a module. You can find them all in the Zend Framework repository on GitHub.

You need the ZendPdf package, just follow the instructions on the page. Documentation is not ready yet simply because it's not a core module. Documentation will probably follow as soon as all bugs are worked out with the core stuff.

Also see the Zend Framework package repository.




回答2:


If you need to generate a PDF in ZF2 environment, there is a brief tutorial how to do that with PD4ML. The approach does not require to program a PDF layout (like createPdfDocument(), startParagraph(), addImage() etc). It just converts an existent rendered view (HTML + CSS + SVG + images) to PDF or optionally to RTF.




回答3:


If you need a module that allow easy to thumbnail, snapshot or PDF generation from a url or a html you can take a look to MvlabsSnappy based on Snappy PHP (5.3+) wrapper for the wkhtmltopdf & wkhtmltoimage conversion utility.



来源:https://stackoverflow.com/questions/12673089/generate-pdf-file-with-zend-framework-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!