如何使用 PHP 创建 PDF 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4666171/
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 13:54:27  来源:igfitidea点击:

How to create a PDF file with PHP?

phppdf

提问by magna

Possible Duplicates:
Convert HTML + CSS to PDF with PHP?

可能的重复:
使用 PHP 将 HTML + CSS 转换为 PDF?

I am working with my new project. I want to generate a new PDF file with the help of PHP code.

我正在处理我的新项目。我想借助 PHP 代码生成一个新的 PDF 文件。

How can I do this? Do you any have any ideas?

我怎样才能做到这一点?你有什么想法吗?

回答by Ahmet Kak?c?

You can try free libraries like fPdf

你可以试试像fPdf这样的免费库

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

FPDF 是一个 PHP 类,它允许使用纯 PHP 生成 PDF 文件,也就是说不使用 PDFlib 库。FPDF 中的 F 代表免费:您可以将其用于任何类型的用途并对其进行修改以满足您的需要。

回答by StasM

Look into Zend_PDFfrom Zend Framework - it allows you to create/manipulate PDFs.

从 Zend Framework查看Zend_PDF- 它允许您创建/操作 PDF。

回答by bertzzie

Use Zend_PDF I guess.

使用 Zend_PDF 我猜。

Check the documentation here: http://framework.zend.com/manual/en/zend.pdf.html

在此处查看文档:http: //framework.zend.com/manual/en/zend.pdf.html

It's the best PDF generator for PHP IMO.

它是 PHP IMO 最好的 PDF 生成器。