gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 11:24:21 24 4
gpt4 key购买 nike

我想向服务器上的 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/

关于javascript - 如何编辑已经上传的pdf文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26985729/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com