Update hard_copy.php
[clinton/MarylandElectronicPetitionSignature.git] / hard_copy.php
CommitLineData
2674a73b 1<?php
44ece581
PM
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
2674a73b
PM
7//Set the Content Type
8header('Content-type: image/jpeg');
9
44ece581 10// Create Image From Existing File -- going to have to make this a reqired size??? 2550x3300
2674a73b
PM
11$jpg_image = imagecreatefromjpeg('files/Green-Party-petition-1-page-001.jpg');
12
13// Allocate A Color For The Text
4e86c3a9 14$black = imagecolorallocate($jpg_image, 0, 0, 0);
2674a73b
PM
15
16// Set Path to Font File
cba2e1ee 17$font_path = 'files/coolvetica rg.ttf';
2674a73b 18
2674a73b 19
44ece581
PM
20
21
22// County on Petition
ca0242f1 23imagettftext($jpg_image, 50, 0, 200, 240, $black, $font_path, 'Baltimore');
44ece581
PM
24// OR
25// City Checkbox
ca0242f1 26imagettftext($jpg_image, 50, 0, 115, 365, $black, $font_path, 'X');
44ece581
PM
27
28
29
30
2674a73b
PM
31
32// Send Image to Browser
33imagejpeg($jpg_image);
34
35// Clear Memory
36imagedestroy($jpg_image);
37?>