设为首页 加入收藏

TOP

PHP7.27: pdf(二)
2019-08-15 23:29:26 】 浏览:25
Tags:PHP7.27: pdf
uot;,"200",""); $data[2]=array("涂聚文","3","女","300",""); $data[3]=array("小涂","4","女","400",""); $data[4]=array("阿文","5","男","500",""); $data[5]=array("小文","6","女","600",""); $width=array(40,40,40,40); //设置每列宽度 for($i=0;$i<count($sheader);$i++) { $pdf->Cell($width[$i],6,$sheader[$i],1); } $pdf->Ln(6); foreach($data as $row) { $pdf->Cell($width[0],6,$row[0],1); $pdf->Cell($width[1],6,$row[1],1); $pdf->Cell($width[2],6,$row[2],1); $pdf->Cell($width[3],6,$row[3],1); $pdf->Cell($width[4],6,$row[4],1); $pdf->Cell($width[5],6,$row[5],1); $pdf->Ln(6); } // Select a standard font (uses windows-1252) $pdf->SetFont('Arial','',14); $pdf->Ln(10); $pdf->Write(5,'The file size of this PDF is only 13 KB.'); $pdf->Output(); ?>

  

<?php

// Optionally define the filesystem path to your system fonts
// otherwise tFPDF will use [path to tFPDF]/font/unifont/ directory
// define("_SYSTEM_TTFONTS", "C:/Windows/Fonts/");

require('tfpdf\tfpdf.php');

$pdf = new tFPDF();
$pdf->AddPage();

// Add a Unicode font (uses UTF-8)
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);

// Load a UTF-8 string from a file and print it
$txt = file_get_contents('./tfpdf/HelloWorld.txt', FALSE, NULL, 20, 1400); //
$pdf->Write(8,$txt);

// Select a standard font (uses windows-1252)
$pdf->SetFont('Arial','',14);
$pdf->Ln(10);
$pdf->Write(5,'The file size of this PDF is only 13 KB.');

$pdf->Output();
?>

  

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇[PHP] 数据结构-链表创建-插入-删.. 下一篇xhprof扩展安装与使用

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目