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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
<?php
require_once('fpdf/fpdf.php');
require_once('fpdi.php');
// initiate FPDI
$pdf =& new FPDI();
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('Etiquette.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, 0, 0, 0);
$pdf-> AcceptPageBreak(0);
$pdf-> SetAutoPageBreak(0);
//////////////////////////////////////////////////////////////////////////////////////
///////////// Titre produit
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(9, 12);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(88.5,17,$_POST["titre_produit"][1],0,1,'C');
//////////////////////////////
///////////// Information 1
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(9, 29);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(88.5,31,$_POST["information_1"][1],0,1,'C');
//////////////////////////////
///////////// Information 2
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(9, 60);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(88.5,31,$_POST["information_2"][1],0,1,'C');
//////////////////////////////
///////////// PRIX
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(9, 91);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(88.5,28.5,$_POST["prix_produit"][1],0,1,'C');
//////////////////////////////
///////////// Information divers
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(40, 130);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(60,15,$_POST["information_autre"][1],0,1,'C');
//////////////////////////////
///////////// LOGO
// now write some text above the imported page
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Image('logo.jpg',9,130,30,15,JPG);
///////////// Titre produit
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(112, 12);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(88.5,17,'Titre',1,1,'C');
//////////////////////////////
///////////// Information 1
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(112, 29);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(88.5,31,'Information1',1,1,'C');
//////////////////////////////
///////////// Information 2
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(112, 60);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(88.5,31,'Information2',1,1,'C');
//////////////////////////////
///////////// PRIX
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(112, 91);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(88.5,28.5,'PRIX',1,1,'C');
//////////////////////////////
///////////// Information divers
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(144, 130);
//$pdf->Write(0, "This is just a simple text");
//$pdf->Cell(80);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Cell(60,15,'Information divers',0,1,'C');
//////////////////////////////
///////////// LOGO
// now write some text above the imported page
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$pdf->Image('logo.jpg',112,130,30,15,JPG);
$pdf->Output('newpdf.pdf', 'I');
$pdf->closeParsers();
?> |
Partager