FPDI를 사용하여 기존 PDF 파일을 편집하고 단일 페이지에 적합합니다. ou는 내가 $tplIdx = $pdf->importPage(1);
첫 페이지를 편집하고있는 것을 볼 수 있습니다. 6 페이지의 pdf 파일이있어서 다른 페이지에 2 개의 변수를 추가해야합니다.기존 PDF 여러 페이지 편집 FPDF 및 FPDI를 사용하는 파일
가능합니까? 방법?
<?php
require_once('fpdf.php');
require_once('fpdi.php');
// initiate FPDI
$pdf = new FPDI();
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('ex.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx, 10, 10, 200);
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(50, 50);
$pdf->Write(0, "Ajay Patel");
$pdf->Output('newpdf1.pdf', 'D');
?>
감사의 말!
@JA 내가, 내가 모든 페이지를 한 페이지 원하는 6 페이지 PDF 파일과 출력을 가져온 –