如何使用FPDF/FPDI获得准确的修改过的PDF? [英] How to get the exact modified PDF using FPDF/FPDI?
本文介绍了如何使用FPDF/FPDI获得准确的修改过的PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个修改PDF并将图像添加到其中的任务,为此,我使用了FPDF和FPDI库.其操作代码如下:
i have a task to modify the PDF and add an image into it, for which I Have used the FPDF and FPDI libraries.. whose action code is given below:
<?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");
?>
但是当我获得修改后的pdf时,我会得到非常失真的修改后的pdf ...其屏幕截图如下:
But When I get the Modified pdf I can get very distorted modified pdf... whose screen shot is given below:
原始文件如下:
因此有人可以帮助我使用相同的代码/修改后的代码来检索正确的修改后的PDF吗??
Hence Could anyone help me in retrieveing the correct Modified PDF using the same code/ modified code..?
推荐答案
其fpdf_tpl.php文件需要通过新下载进行更新
its fpdf_tpl.php file needed to be updated with new download
这篇关于如何使用FPDF/FPDI获得准确的修改过的PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文