PHP5 PDF 生成? [英] PHP5 PDF Generation?

查看:54
本文介绍了PHP5 PDF 生成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直在考虑用 PHP 构建和实现我自己的发票系统,我想要一个可选的下载/生成 PDF"按钮,该按钮基于创建的模板或基于关闭的模板创建 PDFhtml/css.

So lately I've been thinking of building and implementing my own invoice system with PHP and I want to have an optional 'Download/Generate PDF' button that creates a PDF based off of either a template that was created or based off of html/css.

我想要一种免费的方法(因为有些方法定价过高)并且希望不会太难使用.最终目标是创造出足以用于商业用途的东西(尽管我无意出售它).

I want a method that is free (seeing as some are ridiculously overpriced) and hopefully not too difficult to use. The end goal is to create something that would be good enough for commercial use (though it's not my intent to sell it).

我听说过诸如 TCPDF、Dompdf、wkhtmlpdf 等选项.但我再次在寻找最正确的选项,并且有可能用于商业用途.我希望根据我的需求提供建议,因为我已经在网站上搜索了相似的主题;我知道不同的库,但不确定我应该使用什么.

I've heard of options such as TCPDF, Dompdf, wkhtmlpdf etc. But again I'm looking for one that would render most correct, and potentially be used commercially. I'd like suggestions specifically based off of what I require as I have searched the site for topics that are similar; I'm aware of the different libraries but not sure what I should use.

提前致谢!:)

推荐答案

这样做了几次后,我的建议是采用现有的库将低级 PDF 工具包装成一个像样的 API,然后构建您的自己的图书馆,专门针对您的需求(开票).

Having done this a couple times, my suggestion would be to take an existing library that wraps up the low level PDF tools into a decent API, and then build your own library that is specific to your needs (invoicing) on top of it.

我建议使用 Zend PDFTCPD 作为构建的基础库.当您将类添加到自己的库中时,您将能够完成表格/行项目生成、页眉、页脚等内容.

I would suggest Zend PDF or TCPDF as a base library to build on. As you add classes to your own library you'll be able to wrap up things like table / line-item generation, headers, footers, etc.

这篇关于PHP5 PDF 生成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆