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

推荐订阅源

Recent Announcements
Recent Announcements
J
Java Code Geeks
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
腾讯CDC
博客园 - 司徒正美
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
I
InfoQ
N
Netflix TechBlog - Medium
L
LangChain Blog
博客园_首页
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
美团技术团队
The Cloudflare Blog
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
H
Help Net Security
Martin Fowler
Martin Fowler
V
Visual Studio Blog

博客园 - 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');
?>