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

时间:2014-11-18 02:43:22

标签: javascript php jquery pdf

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

示例
我将文件上传到uploads / aaa.pdf
我希望在文件上传/ aaa.pdf

中添加页脚

我怎么做?

1 个答案:

答案 0 :(得分:1)

这项工作

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/