-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneratorpdf.php
executable file
·108 lines (84 loc) · 2.64 KB
/
generatorpdf.php
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
<?php
/**
* Created by PhpStorm.
* User: root
* Date: 11/20/15
* Time: 10:02 AM
*/
include 'phpqrcode/qrlib.php';
require('fpdf/fpdf.php');
//QRcode::png('PHP QR Code :)');
if(isset($_POST) AND isset($_POST['prefix']) AND isset($_POST['begin']) AND isset($_POST['amount'])){
$begin=$_POST['begin'];
$amount=$_POST['amount'];
$prefixUse=$_POST['prefix'];
if($_POST['prefix']==""){
$prefixUse="T'AS RIEN MIS";
}
if($amount<4){
header("Location:index.php");
}
// header("Content-type: image/png");
// $imagePNG = imagecreate(827,1170);
//
// $fondBlanc= imagecolorallocate($imagePNG,255,255,255);
// imagepng($imagePNG,"fond.png");
//
// $fist_image=imagecreatefrompng("fond.png");
$pdf=new FPDF('P','pt','A4');
$count=0;
$pdf->AddPage();
for($m=0;$m<$amount;$m++){
$m=$m+19;
for($i=0;$i<4;$i++){
$begin=$begin+1;
for($j=0;$j<5;$j++){
$count=$i+$j;
$currentQR=QRcode::png($prefixUse.$begin,"image.png", QR_ECLEVEL_L, 7);
$im = imagecreate(185,200);
$bg=imagecolorallocatealpha($im,255,255,255,127);
$textcolor=imagecolorallocate($im,0,0,0);
//imagecolortransparent($im);
imagepng($im,"trans.png");
imagestring($im,5,50,180,$prefixUse.$begin,$textcolor);
imagepng($im,"color.png");
imagecopymerge($im,imagecreatefrompng("image.png"),0,0,0,0,200,200,80);
imagepng($im,"qr.png");
$pdf->Image('qr.png',$i*150,$j*150,150,150);
}
}
$i=0;
$j=0;
$pdf->AddPage();
}
// $pdf->AddPage();
//
// for ($i=0;$i<4;$i++){
// for($j=0;$j<$amount/4;$j++){
// // $currentQR=QRcode::png($prefixUse.$i.$j,"image.png", QR_ECLEVEL_L, 10);
// ++$begin;
// $currentQR=QRcode::png($prefixUse.$begin,"image.png", QR_ECLEVEL_L, 7);
//
// $im = imagecreate(185,200);
// $bg=imagecolorallocatealpha($im,255,255,255,127);
// $textcolor=imagecolorallocate($im,0,0,0);
// //imagecolortransparent($im);
// imagepng($im,"trans.png");
// imagestring($im,5,50,180,$prefixUse.$begin,$textcolor);
// imagepng($im,"color.png");
// imagecopymerge($im,imagecreatefrompng("image.png"),0,0,0,0,185,200,80);
//
// imagecopymerge($fist_image,$im,$i*200,$j*200,5,5,200,200,99);
// }
// if($begin==$amount){
// break;
// }
// imagepng($fist_image,"fin.png");
// }
// $pdf->Image('fin.png',0,0,-100);
$pdf->Output();
// imagepng($fist_image);
}else{
header("Location:index.php");
}
?>