我在本地主机上使用FPDM库(http://www.fpdf.org/en/script/script93.php)和PDFtk Pro工具(https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/)来合并可编辑的PDF。我能够成功合并PDF,也可以将表单字段值放入PDF文本框中。
有人可以帮助我如何将图像放置在特定位置(坐标或任何方式)吗? 我的PHP代码段如下:
function my_custom_menu_page()
{
require('library/fpdm.php');
$fields = array(
'name' => 'name as shown on your income tax return',
'business_name' => 'business name',
'individual_proprietor_llc' => "yes",
'tin_ssn_1' => '2',
'tin_ssn_2' => '0',
'date_of_person' => date("Y-m-d")
);
/* This is editable PDF. */
$pdf = new FPDM(LOCATION.'/fixed.pdf');
$pdf->Load($fields, false);
/*
Need Code/process to put image at specific location.
*/
$pdf->Merge();
/* This will be merged PDF. */
$file_path = SAVE_FILE_LOCATION.'resultennn.pdf';
$pdf->Output($file_path,'F');
}
我还在/ *需求代码/进程中尝试过将图像放置在特定位置。 * /此位置低于2个代码,但不起作用。
$pdf->Image('testimage.jpg',60,30,90,0,'JPG');
$pdf->Cell(0, 0, $pdf>Image('testimage.jpg', 0,0,50,0,"JPG"),0,'L');
请帮助。
谢谢