PHP PDF 生成器建议

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12350265/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 03:24:13  来源:igfitidea点击:

PHP PDF Generator Advice

phppdf

提问by Ben Carey

Can anybody advise on the best PDF generator class/library to use with PHP? Preferably one which is maintained.

有人可以就与 PHP 一起使用的最佳 PDF 生成器类/库提出建议吗?最好是被维护的。

I am aware that this is a duplicate of the following question, however, the accepted answer is over 3 years old and I want to know whether the answer has changed since this time.

我知道这是以下问题的重复,但是,已接受的答案已超过 3 年,我想知道此后答案是否已更改。

Which one is the best PDF-API for PHP?

哪个是 PHP 最好的 PDF-API?

Thank you

谢谢

采纳答案by Mohamed Navas

Try TCPDF, have good features http://www.tcpdf.org/examples.php

试试TCPDF,有很好的特性 http://www.tcpdf.org/examples.php

Also simple HTML to PDF Converter API in (PHP, C#, ASP.net C#, ASP VB.net, JAVA,...)

也是简单的 HTML 到 PDF 转换器 API (PHP, C#, ASP.net C#, ASP VB.net, JAVA,...)

from "PDF CROWD" http://pdfcrowd.com/html-to-pdf-api/

来自“PDF CROWD” http://pdfcrowd.com/html-to-pdf-api/

very simple to use, but I think this API may need to purchase even they provide a free test account..

使用起来非常简单,但我认为即使他们提供免费的测试帐户,这个API也可能需要购买..

回答by Peter Es

Have you tried http://www.PDFnow.com?

你试过http://www.PDFnow.com吗?

Provides a powerful template engine, and is pretty easy to use.

提供了一个强大的模板引擎,并且非常容易使用。

Supports complex layouts, layouts for multiple pages, invoices spreading separate pages, pagenumbers, headers, footers, etc. Definitively much better than fpdf.

支持复杂的布局、多页布局、发票分页、页码、页眉、页脚等。绝对比 fpdf 好得多。

You can simply integrate it into your PHP code by:

您可以通过以下方式将其简单地集成到您的 PHP 代码中:

generatePdf(<templateName>, <ParameterArray>);

very straightforward.

非常直接。

回答by Mad Angle

Best One is TCPDF

最好的一个是TCPDF

http://www.tcpdf.org/

http://www.tcpdf.org/

Never Use DOMPDF

永远不要使用DOMPDF

回答by WayFarer

Have a look on http://wkhtmltopdf.org/Convert HTML to PDF using WebKit engine. It can be used from PHP easily. For example, there is a bundle for Symfony2: http://knpbundles.com/KnpLabs/KnpSnappyBundle

查看http://wkhtmltopdf.org/使用 WebKit 引擎将 HTML 转换为 PDF。它可以很容易地从 PHP 中使用。例如,Symfony2 有一个包:http: //knpbundles.com/KnpLabs/KnpSnappyBundle