Generate PDF file with Zend Framework 2 [closed]

2019-05-05 18:08发布

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?

3条回答
Bombasti
2楼-- · 2019-05-05 18:55

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楼-- · 2019-05-05 18:56

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.

查看更多
Melony?
4楼-- · 2019-05-05 18:57

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.

查看更多
登录 后发表回答