fpdf基本用法

//关闭自动创页
 $this->SetAutoPageBreak(false);
 
 //添加一页
 $this->AddPage();
 
 //应用程序
 $this->SetCreator('colin',true);
 
 //设置显示模式,显示比例等
 $this->SetDisplayMode('real','two');
 
 //设置坐标位置
 $y_axis_initial = 30;
 $x_axis_initial = 30;
 $this->SetY($y_axis_initial);
 $this->SetX($x_axis_initial);
 
 //设置标题,true表示utf-8编码文字
 $this->SetTitle('标题',true);
 
 //设置主题
 $this->SetSubject('主题',true);
 
 //设置主题
 $this->SetKeywords('关键词',true);
 
 //设置作者
 $this->SetAuthor('小陈',true);
 
 //是否压缩
 $this->SetCompression(true);
 
 //设置直线宽度,单位mm
 $this->SetLineWidth(0.4);
 
 //绘制直线
 $this->Line(0,0,50,50);
 
 //绘制矩形
 $this->Rect(0,0,50,50);
 
 //绘制获取页码
 $pageNumber = $this->PageNo();
 
 //创建连接
 $this->SetLink('http://www.baidu.com',0);
 
 //添加
 $link = $this->AddLink('http://www.baidu.com',0,1);
 
 //一片区域天剑连接
 $this->Link(0,0,20,20,$link);
 
 //获取横坐标圆点值
 $abscissa = $this->GetX();
 
 //获取纵坐标圆点值
 $ordinate = $this->GetY();
 
 //获取字符串长度
 $stringWidth = $this->GetStringWidth('sdfs上的发生大幅創業板');
 
 
 //设置字体大小
 $this->SetFontSize(19);
 
 //设置绘制颜色,RGB格式,对绘制直线等有用
 $this->SetDrawColor(0,0,255);
 
 //设置填充颜色,RGB格式,对cell等有用
 $this->SetFillColor(255,255,255);
 
 //设置字体大小
 $this->SetFontSize(19);
 
 //添加文字,并制定连接
 $this->write(100,'sdfs上的发生大幅創業板'.$pageNumber,'http://www.baidu.com');
 
 //填充字的矩形
 $this->Ln(0);
 $this->Cell(30,30,'PRICE',1,50,'C',true,'http://www.baidu.com');
 $this->Text(150, 20, 'sdfsdfs上的发生大幅創業板');
 
 $this->AddPage();
 
 $this->Line(0,50,50,0);
 
 $this->SetDrawColor(255,0,255);
 $this->Line(0,0,50,50);
 
 
 $this->AliasNbPages();
 
 //发送文件,I发送到浏览器,D下载文件,F保存到文件,S返回字符串
 $this->Output('simple.pdf','I');
 
// $this->pdf->Output($this->pdfSavePath.'/simple.pdf','F');

转载于:https://my.oschina.net/colin86/blog/521423

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值