Update hard_copy.php
[clinton/MarylandElectronicPetitionSignature.git] / hard_copy.php
1 <?php
2 // imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text )
3 // x how far from left
4 // y how far from top
5
6
7 //Set the Content Type
8 header('Content-type: image/jpeg');
9
10 // Create Image From Existing File -- going to have to make this a reqired size??? 2550x3300
11 $jpg_image = imagecreatefromjpeg('files/Green-Party-petition-1-page-001.jpg');
12
13 // Allocate A Color For The Text
14 $black = imagecolorallocate($jpg_image, 0, 0, 0);
15
16 // Set Path to Font File
17 $font_path = 'files/coolvetica rg.ttf';
18 $font_path_sig = 'files/Claston Script.ttf';
19
20
21
22 // County on Petition
23 imagettftext($jpg_image, 50, 0, 220, 260, $black, $font_path, 'Baltimore');
24 // OR
25 // City Checkbox
26 imagettftext($jpg_image, 50, 0, 115, 365, $black, $font_path, 'X');
27
28 // Slot 1 on Petition
29 // name
30 imagettftext($jpg_image, 50, 0, 350, 1070, $black, $font_path, 'Patrick Michael McGuire');
31 // signed
32 imagettftext($jpg_image, 75, 0, 400, 1200, $black, $font_path_sig, 'Patrick Michael McGuire');
33 // address
34 imagettftext($jpg_image, 50, 0, 400, 1300, $black, $font_path, '501 Spring Ave Lutherville 21093');
35 // date of birth
36 imagettftext($jpg_image, 50, 0, 1800, 1070, $black, $font_path, '02 09 1980');
37 // date signed
38 imagettftext($jpg_image, 50, 0, 1800, 1200, $black, $font_path, '05 07 2020');
39
40
41
42 // Send Image to Browser
43 imagejpeg($jpg_image);
44
45 // Clear Memory
46 imagedestroy($jpg_image);
47 ?>