相关疑难解决方法(0)

如何使用FPDF/FPDI获得精确修改的PDF?

我有一个任务是修改PDF并在其中添加一个图像,我已经使用了FPDF和FPDI库..其动作代码如下:

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

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

//Set the source PDF file
$pagecount = $pdf->setSourceFile("Completed.pdf");

//Import the first page of the file
$tpl = $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($tpl, 20, 30, 170);

#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->Rotate(90);
$pdf->Image('think.jpg',120,240,20,20);
$pdf->Image('think.jpg',120,260,20,20);
//$pdf->Write(0, "Hello World");

$pdf->Output("modified_pdf.pdf", "F");
?>
Run Code Online (Sandbox Code Playgroud)

但是当我得到Modified …

php pdf fpdf fpdi

7
推荐指数
1
解决办法
6262
查看次数

标签 统计

fpdf ×1

fpdi ×1

pdf ×1

php ×1