summaryrefslogtreecommitdiff
path: root/bin/ink1-ifyllning.pl
blob: a5f7fb0b1a841d08be454c528b74d6188f579924 (plain)
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
#!/usr/bin/perl

use strict;
use warnings;

use GD::SVG;

open FILE, $ARGV[0] or die $!;
my %values;
my ($key, $value);
while (my $line = <FILE>) {
     chomp($line);
     ($key, $value) = $line =~ /^(.*): *(.*)/g;
     $values{$key} = $value;
}
close FILE;

my $ink1_1 = GD::SVG::Image->new(792, 1122);
my $ink1_2 = GD::SVG::Image->new(792, 1122);

my $ink1_1_white = $ink1_1->colorAllocate(255,255,255);
my $ink1_1_black = $ink1_1->colorAllocate(0,0,0);
my $ink1_2_white = $ink1_2->colorAllocate(255,255,255);
my $ink1_2_black = $ink1_2->colorAllocate(0,0,0);
my $font = gdLargeFont;

$ink1_1->startGroup('ink1-1');
$ink1_1->rectangle(0,0,792,1122, $ink1_1_white);

$ink1_1->string($font, 688, 432, $values{'p7_4'}, $ink1_1_black);

$ink1_1->endGroup;

$ink1_2->startGroup('ink1-2');
$ink1_2->rectangle(0,0,792,1122, $ink1_2_white);

print "Before\n";
$ink1_2->string($font, 212, 124, $values{'p10_1'}, $ink1_2_black);
print "After\n";

# 266 is too far left, 280 is too far right.
my $contact_column = 273;
$ink1_2->string($font, $contact_column, 984, $values{'email'}, $ink1_2_black);
$ink1_2->string($font, $contact_column+356, 984, $values{'phone'}, $ink1_2_black);

$ink1_1->endGroup;

open(SVGFILE, ">ink1_1-overlay.svg");
print SVGFILE $ink1_1->svg;
open(SVGFILE, ">ink1_2-overlay.svg");
print SVGFILE $ink1_2->svg;