96cc513483723c745215a0c1c07dac3d5f5d1ec8
[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
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, 300, 1100, $black, $font_path, 'Patrick Michael McGuire');
31 // address
32 imagettftext($jpg_image, 50, 0, 300, 1200, $black, $font_path, '501 Spring Ave Lutherville 21093');
33 // date of birth
34 imagettftext($jpg_image, 50, 0, 2000, 1100, $black, $font_path, '02 09 1980');
35 // date signed
36 imagettftext($jpg_image, 50, 0, 2000, 1300, $black, $font_path, '05 07 2020');
37
38
39
40 // Send Image to Browser
41 imagejpeg($jpg_image);
42
43 // Clear Memory
44 imagedestroy($jpg_image);
45 ?>