 |
|
เตรียม 3 อย่าง
1.fpdf
2.fpdi
3.ไฟล์ Template PDF
index.php
Code (PHP)
<?php
require_once('fpdf\fpdf.php');
require_once('fpdf\fpdi.php');
// initiate FPDI
$pdf = new FPDI();
// add a page
$pdf->AddPage();
// set the source file
$pdf->setSourceFile('TestDoc.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at position 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx, 0, 0, 0);
// now write some text above the imported page
$PDF->SetFont('THSarabun','',16);
$pdf->SetTextColor(255, 0, 0);
$pdf->SetXY(30, 30);
$pdf->Write(0, 'This is just a simple text');
$pdf->Output();
?>
Tag : PHP, HTML, PDF, Web Services, Appserv
|
ประวัติการแก้ไข 2020-01-06 16:41:09 2020-01-06 16:41:56
|
 |
 |
 |
 |
Date :
2020-01-06 16:35:45 |
By :
masak |
View :
3957 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |