使用 PHP 创建 PDF 的最佳方式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2132015/
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
Best way to create a PDF with PHP
提问by Samuurai
I've been reading up on creating a PDF file with PHP and am wondering what the easiest option is.
我一直在阅读有关使用 PHP 创建 PDF 文件的信息,并且想知道最简单的选项是什么。
Create a PDF template, open it and replace placeholder text -- which function do I use to open an existing PDF for editing?
Create a PDF template and place text on it using co-ordinates
Create a HTML document then convert it to PDF using some sort of free tool?
Create a PDF from scratch using PHP (this seams like a time consuming way to do it).
创建一个 PDF 模板,打开它并替换占位符文本——我使用哪个功能打开现有的 PDF 进行编辑?
创建 PDF 模板并使用坐标在其上放置文本
创建一个 HTML 文档,然后使用某种免费工具将其转换为 PDF?
使用 PHP 从头开始创建 PDF(这看起来像是一种耗时的方法)。
采纳答案by Sarfraz
回答by Mukesh Chapagain
If you want very advanced features in PDF creation then try TCPDF. If you want just minimal features of PDF creation and want a smaller in size class then try FPDF.
如果您想要 PDF 创建中的非常高级的功能,请尝试TCPDF。如果您只想要创建 PDF 的最小功能并想要更小的尺寸类,请尝试FPDF。
The following link has an article describing these two PDF generating class libraries: Easily create PDF with PHP
以下链接有一篇文章描述了这两个PDF生成类库:用PHP轻松创建PDF

