惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
罗磊的独立博客
C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
B
Blog RSS Feed

博客园 - N/A2011

Managing Hierarchical Data in MySQL php soapclient with wsse 转贴 MySQL Multiple Result Procs in PHP 转贴 jQuery Datepicker by Example 转贴 Using MySQL Stored Procedures with PHP mysql/mysqli/pdo open office (java) ant + emma + junit Copy all files recursively from one folder to another RecursiveFileFinder 转贴: 怎样找第一份工作 PerformanceCounter in .net Trace in .net Logger in .net 转贴: 傅立叶级数(Fourier Series) 推导 CAS in .net Encrypting and Decrypting in .net Access Control List in .net User and Data Security in .net Unmanaged code in .net
php generate pdf
N/A2011 · 2010-04-28 · via 博客园 - N/A2011

代码

<?php
require_once(dirname(__FILE__)."/lib/fpdf/fpdf.php");
require_once(dirname(__FILE__)."/lib/fpdi/fpdi.php");
$filename = "file/template.pdf";
$pdf=new FPDI('P','mm','Legal');//page one
$pdf->AddPage();
$pdf->setSourceFile($filename);
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);
//default autonumber
$pdf->SetFont('Arial','B',12);
$pdf->Cell(135);
$pdf->Cell(50,12,'sss',0,0,'L');
//A1
$pdf->Ln(26);
$pdf->SetFont('Arial','B',10);
$pdf->Cell(47);
$pdf->Cell(50,12,'xxxx',0,0,'L');
//A2,A3,A4,A5
$pdf->Ln(4);
$pdf->SetFont('Arial','B',10);
$pdf->Cell(47);
$pdf->Cell(50,12,'xxxx',0,0,'L');
//B1
$pdf->Ln(16);
$pdf->SetFont('Arial','B',10);
$pdf->Cell(47);
$pdf->Cell(50,12,'xxxxx',0,0,'L');
//B2,B3,B4,B5
$pdf->Ln(7);
$pdf->SetFont('Arial','B',10);
$pdf->Cell(47);
$pdf->Cell(50,12,'xxxxxx',0,0,'L');
//B6
$pdf->Ln(5);
$pdf->SetFont('Arial','B',10);
$pdf->Cell(47);
$pdf->Cell(50,12,'xxxxx',0,0,'L');//page two
$pdf->AddPage();
$pdf->setSourceFile($filename);
$tplIdx = $pdf->importPage(2);
$pdf->useTemplate($tplIdx);
//default autonumber
$pdf->SetFont('Arial','B',9);
$pdf->Cell(152);
$pdf->Cell(50,9,'xxxx',0,0,'L');header("Content-Transfer-Encoding", "binary");
header('Cache-Control: maxage=3600'); //Adjust maxage appropriately
header('Pragma: public');
$pdf->Output();
//$pdf->Output('document.pdf', 'D');
?>