在FPDF中设置纸张尺寸 [英] Setting paper size in FPDF

查看:631
本文介绍了在FPDF中设置纸张尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将fpdf中的纸张尺寸设置为字母尺寸的一半,大约为8.5x5.5 inc.我该怎么办?
我用php语言编写的fpdf函数是

i want to seting paper size in fpdf to a half of letter size, it's approximately 8.5x5.5 inc. How can i do that?
My fpdf function in php language is

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

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

is there any solution? Thank's before for your help..

推荐答案

他们在文档中对此进行了说明. FPDF构造函数:

FPDF([字符串方向[,字符串单位[,混合大小]]])

这是类的构造函数.它允许设置所有方法中使用的页面大小,方向和度量单位(字体大小除外). 参数...

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 ...

大小

用于页面的大小.它可以是以下值之一(不区分大小写):

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

A3 A4 A5 信 法律

A3 A4 A5 Letter Legal

或包含宽度和高度的数组(以单位给定的单位表示).

他们甚至举了一个自定义大小的示例:

They even give an example with custom size:

自定义页面尺寸为100x150毫米的示例:

Example with a custom 100x150 mm page size:

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

这篇关于在FPDF中设置纸张尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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