FPDF使用教程中文版
时间:2008-12-22
来源:互联网
不同的示例快速向你展示如何使用FPDF。你将找到所有已经说明的那些主要的功能。
- Tutorial 1: Minimal example 教程1:最小的例子
- Tutorial 2: Header, footer, page break and image 教程2:页眉、页脚、分页和图像
- Tutorial 3: Line breaks and colors 教程3:换行和颜色
- Tutorial 4: Multi-columns 教程4:分栏
- Tutorial 5: Tables 教程5:表格
- Tutorial 6: Links and flowing text 教程6:链接和流动的文本?
- Tutorial 7: Adding new fonts and encoding support 教程7:增加新字体和编码支持
想来想去,不如直接加个注释完事。这个帖子算是废了。
作者: Fising 发布时间: 2008-12-22
Let's start with the classic example:
让我们以这个传统的范例作为开始:
<?php
require('fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>
After including the library file, we create an FPDF object. The FPDF() constructor is used here with the default values: pages are in A4 portrait and the unit of measure is millimeter. It could have been specified explicitly with:
包含进库文件之后,我们创建了一个FPDF对象。这里使用了默认值调用FPDF()这个构造器:纸张类型为A4,计量单位为毫米。它可以被明确的指定:
$pdf=new FPDF('P','mm','A4');
It is possible to use landscape (L), other page formats (such as Letter and Legal) and units of measure (pt, cm, in).
使用landscape (L)其他页面格式(例如信件和律师函)和计量单位(pt,cm和in)。
作者: Fising 发布时间: 2008-12-22
作者: 落叶人生 发布时间: 2008-12-22
作者: sinopf 发布时间: 2008-12-22
现在还没有页面,所以我们必须使用AddPage()添加一个。开始处位于左上角,当前位置被默认的置于距离页面边缘1厘米处。可以使用SetMargins()对这个边距进行改变。
Before we can print text, it is mandatory to select a font with SetFont(), otherwise the document would be invalid. We choose Arial bold 16:
在我们打印文本之前,必须使使用SetFont()要为其选择一个字体,不然这个文档将无效。我们选择Arial,粗体,16磅:
$pdf->SetFont('Arial','B',16);
We could have specified italics with I, underlined with U or a regular font with an empty string (or any combination). Note that the font size is given in points, not millimeters (or another user unit); it is the only exception. The other standard fonts are Times, Courier, Symbol and ZapfDingbats.
我们可能对于一个空字符串(或者它的其他联合体)指定了斜体,下划线或者常规字体。记住:字体是以磅值为单位给出的,没有毫米(或者其他单位)。这是仅有的意外情况。其他标准字体是Times,Courier,Symbol和ZapfDingbats.
作者: Fising 发布时间: 2008-12-22
作者: kingbanner 发布时间: 2008-12-22
作者: Fising 发布时间: 2008-12-22
作者: sinopf 发布时间: 2008-12-22
我建议咱们主动删帖,把位子腾出来让Fising接着写,这样也便于今后咱们再查询。同意不?
http://blog.sinopf.com/pic.php

作者: Fising 发布时间: 2008-12-22
作者: longxinhe 发布时间: 2009-02-12
作者: 可笑可笑 发布时间: 2009-06-18
作者: idea360 发布时间: 2009-06-30
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28