FPD 및 FPDF를 사용하여 PDF를 생성하려고하는데 셀을 만들 때 문제가 있습니다. fillcolor를 사용하고 싶습니다. 따라서 셀에는 배경색이 있습니다. 대한FPDI 및 FPDF 사용
는 지금은 같이있다 :
<?php
require_once('fpdf/fpdf.php');
require_once('pdf/fpdi.php');
$pdf = new FPDI();
$pdf->AddPage();
$pdf->setSourceFile('anolis_dopis_a4.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
//use the imported page and place it at point 0,0; calculate width and height
//automaticallay and ajust the page size to the size of the imported page
$pdf->useTemplate($tplIdx, 0, 0, 0, 0, true);
// now write some text above the imported page
$pdf->SetFont('Arial', '', '13');
$pdf->SetTextColor(0,0,0);
//set position in pdf document
$pdf->SetXY(40, 50);
//first parameter defines the line height
$pdf->Write(0, 'gift code');
$pdf->SetXY(40, 55);
$pdf->Write(0, 'gift code');
//HERE I WANT TO HAVE BACKGROUND COLOR
$pdf->Cell(100,10,"bla bla",1,"left","");
//force the browser to download the output
$pdf->Output('test.pdf', 'D');
?>
$ x & $ y'$ outPdf-> useTemplate ($ outPdf-> importPage ($ i), null, null, 0, 0, true); '에서 Null을 사용할 때만 효과가있었습니다. 그렇지 않으면 페이지를 A4로 자릅니다. – juanmf