如何编辑已经上传的pdf文件?

广功

我想向服务器上的pdf文件添加页脚。

示例
我将文件上传到uploads / aaa.pdf
,我想在文件uploads / aaa.pdf中添加页脚

我该怎么办?

广功

这项工作

require_once('fpdf.php');
require_once('fpdi.php');

$pdf =& new FPDI();
$pdf->AddPage();

//Set the source PDF file
$pagecount = $pdf->setSourceFile(“Tally_PO.pdf”);

//Import the first page of the file
$tppl = $pdf->importPage(1);

//Use this page as template
// use the imported page and place it at point 20,30 with a width of 170 mm
$pdf->useTemplate($tppl, -10, 20, 210);

#Print Hello World at the bottom of the page

//Select Arial italic 8
$pdf->SetFont(‘Arial’,”,8);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(90, 160);

$pdf->Write(0, “Hello World”);

$pdf->Output(“modified_pdf.pdf”, “F”);

参考对象:http : //pranavom.wordpress.com/2011/03/15/modify-pdf-using-fpdffpdi-library/

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章