php - 在 FPDF 中设置纸张大小

标签 php fpdf

我想将 fpdf 中的纸张大小设置为字母大小的一半,大约为 8.5x5.5 inc。我该怎么做?
我的 php 语言的 fpdf 函数是

$pdf = new FPDF('P','mm','?????');

有什么解决办法吗?之前感谢您的帮助..

最佳答案

他们在 documentation for the FPDF constructor 中说:

FPDF([string orientation [, string unit [, mixed size]]])

This is the class constructor. It allows to set up the page size, the orientation and the unit of measure used in all methods (except for font sizes). Parameters ...

size

The size used for pages. It can be either one of the following values (case insensitive):

A3 A4 A5 Letter Legal

or an array containing the width and the height (expressed in the unit given by unit).

他们甚至给出了一个自定义尺寸的例子:

Example with a custom 100x150 mm page size:

$pdf = new FPDF('P','mm',array(100,150));

关于php - 在 FPDF 中设置纸张大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10426853/

相关文章:

php - 我可以在函数外部看到数组,但在函数内部看不到数组,如何在函数内部传递变量?

php - 在 PHP 中将所有行元素打印为树

php - 当我刷新我的页面时,它会自动将值输入到数据库 Codeigniter

php - Jquery UI datepicker 字段中来自数据库的 Prefil 日期

javascript - FPDF 不显示多于一张图像

php - 在 PDF 文件中禁用自动旋转和居中

PHP只能打开777权限的文件

php - 绕过我的需要明文大小的 XOR 加密的方法

php - 如何使用 php 和 fpdf 创建发票 pdf?

php - fpdf: header 在 fpdf 中不起作用