1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
require_once('../configuration.php');
include('../session_simul.php');
// lib to write to PDF
require_once('../lib/fpdf.php');
// lib to import existing PDF documents into FPDF
require_once('../lib/fpdi.php');
$page1 = monfichier.pdf";
$pdf= new FPDI();
$pdf->AddPage();
// import the template PFD
$pdf->setSourceFile($page1);
// select the first page
$tplIdx = $pdf->importPage(1);
// use the page we imported
$pdf->useTemplate($tplIdx);
// set font, font style, font size.
$pdf->SetFont('Times','B',10);
// set initial placement
$pdf->SetXY(25, 80);
// line break
$pdf->Ln(5);
// go to 25 X (indent)
$pdf->SetX(25);
// write
$pdf->Write(0, ucwords(strtolower($name)));
header("Content-Transfer-Encoding", "binary");
header('Cache-Control: maxage=3600'); //Adjust maxage appropriately
header('Pragma: public');
$pdf->Output('document.pdf', 'D'); |
Partager