line |
true |
false |
branch |
188
|
8 |
130 |
unless exists $valid_constructor_keys{$_} |
191
|
26 |
8 |
if (exists $params{'PageMode'} and defined $params{'PageMode'}) |
199
|
1 |
25 |
unless exists $valid_page_mode_values{$params{'PageMode'}} |
202
|
2 |
31 |
if (exists $params{'Debug'} and defined $params{'Debug'}) |
205
|
1 |
1 |
unless $params{'Debug'} =~ /^\d+$/ and $params{'Debug'} >= 0 |
229
|
1 |
31 |
if (defined $params{'fh'}) { } |
|
26 |
5 |
elsif (defined $params{'filename'}) { } |
234
|
0 |
26 |
unless defined $fh |
240
|
25 |
7 |
if defined $params{'PageMode'} |
246
|
25 |
7 |
if defined $params{'Author'} |
247
|
0 |
32 |
if defined $params{'Creator'} |
248
|
25 |
7 |
if defined $params{'Title'} |
249
|
0 |
32 |
if defined $params{'Subject'} |
250
|
0 |
32 |
if defined $params{'Keywords'} |
253
|
0 |
32 |
if (defined $params{'CreationDate'}) |
260
|
1 |
31 |
if (defined $params{'Debug'}) |
340
|
1 |
50 |
unless exists $valid_new_page_parameters{$key} |
346
|
0 |
50 |
if defined $params{'Resources'} |
347
|
23 |
27 |
if defined $params{'MediaBox'} |
348
|
0 |
50 |
if defined $params{'CropBox'} |
349
|
0 |
50 |
if defined $params{'ArtBox'} |
350
|
0 |
50 |
if defined $params{'TrimBox'} |
351
|
0 |
50 |
if defined $params{'BleedBox'} |
352
|
0 |
50 |
if defined $params{'Rotate'} |
403
|
1 |
128 |
unless exists $valid_font_parameters{$key} |
406
|
3 |
125 |
if defined $value and not exists $valid_font_parameters{$key}{$value} |
455
|
0 |
34 |
unless exists $params{'Title'} |
457
|
0 |
34 |
unless defined $params{'Title'} |
459
|
14 |
20 |
if (defined $params{'Destination'}) |
461
|
0 |
14 |
unless ref $params{'Destination'} eq 'PDF::Create::Page' |
464
|
18 |
16 |
if (defined $params{'Parent'}) |
466
|
0 |
18 |
unless ref $params{'Parent'} eq 'PDF::Create::Outline' |
469
|
9 |
25 |
unless (defined $self->{'outlines'}) |
479
|
20 |
14 |
unless defined $params{'Destination'} |
515
|
28 |
0 |
if (defined $name) { } |
518
|
1 |
27 |
unless exists $pagesizes{$name} |
536
|
5 |
0 |
if (defined $v) |
537
|
2 |
3 |
unless $v =~ /^1\.[0,1,2,3]$/ |
562
|
14 |
1 |
if (defined $self->{'fh'} and defined $self->{'filename'}) |
580
|
5 |
10 |
if defined $self->{'outlines'} |
599
|
143 |
84 |
unless defined $type |
602
|
0 |
227 |
if defined $self->{'reservations'}{$name} |
612
|
2 |
225 |
if ($type eq 'Annotation') |
631
|
0 |
7 |
unless defined $comment |
681
|
2 |
0 |
if ($params{'Subtype'} eq 'Link') { } |
682
|
0 |
2 |
unless defined $params{'URI'} |
683
|
0 |
2 |
unless defined $params{'x'} |
684
|
0 |
2 |
unless defined $params{'y'} |
685
|
0 |
2 |
unless defined $params{'w'} |
686
|
0 |
2 |
unless defined $params{'h'} |
704
|
2 |
0 |
if (defined $params{'Border'}) |
754
|
1 |
1 |
if ($filename =~ /\.gif$/i) { } |
|
1 |
0 |
elsif ($filename =~ /\.jpg$/i or $filename =~ /\.jpeg$/i) { } |
761
|
0 |
2 |
unless ($image->Open($filename)) |
778
|
1 |
1 |
if ($image->{'colorspacesize'}) { } |
797
|
2 |
0 |
if ($#a >= 0) |
810
|
1 |
1 |
if ($image->{'transparent'}) |
829
|
5 |
25 |
unless defined $First |
832
|
9 |
21 |
if (defined $outline->{'Kids'} and scalar @{$outline->{'Kids'};}) |
841
|
30 |
23 |
if $brother == $outline |
843
|
16 |
14 |
if $j < $#$brothers |
845
|
16 |
14 |
if $j |
848
|
5 |
25 |
unless defined $outline->{'Parent'}{'id'} |
854
|
9 |
21 |
if $count |
864
|
5 |
0 |
if $count |
881
|
0 |
15 |
unless scalar @$t |
904
|
1 |
1 |
if (defined $self->{'reservations'}{"ImageColorSpace$xobject"}) |
920
|
14 |
24 |
defined $page->{'Kids'} && scalar @{$page->{'Kids'};} ? : |
931
|
19 |
0 |
if (ref $v eq 'ARRAY') { } |
943
|
1 |
19 |
unless $k eq 'ProcSet' and do {
my $l = [];
if (ref $v eq 'ARRAY') {
map {push @$l, $self->name($_);} @$v;
}
else {
push @$l, $self->name($v);
};
$resources->{'ProcSet'} = $self->array(@$l)
} or $k eq 'fonts' and do {
my $l = {};
map {$$l{"F$_"} = $self->indirect_ref(@{$$self{'fontobj'}{$_};});} keys %{$$page{'resources'}{'fonts'};};
$resources->{'Font'} = $self->dictionary(%$l)
} |
950
|
0 |
38 |
if (defined $resources->{'Annotation'}) |
955
|
1 |
37 |
if (defined $resources->{'XObject'}) { } |
960
|
18 |
19 |
if scalar keys %$resources |
965
|
15 |
175 |
if (defined $page->{$k}) |
971
|
0 |
38 |
if defined $page->{'rotate'} |
972
|
24 |
14 |
if ($type eq 'Page') { } |
976
|
23 |
1 |
if (defined $page->{'contents'}) |
985
|
1 |
23 |
if (defined $self->{'annot'}) |
989
|
0 |
2 |
if $self->{'annot'}{$annot_number}{'page_name'} ne $name |
998
|
1 |
0 |
if $is_annots |
1005
|
14 |
0 |
if defined $page->{'Parent'} |
1025
|
0 |
15 |
unless defined $self->{'crossrefsubsection'} |
1058
|
212 |
0 |
$entry->[2] ? : |
1096
|
15 |
0 |
if defined $self->{'info'} |
1099
|
45 |
45 |
unless defined $self->{'trailer'}{$k} |
1101
|
0 |
45 |
ref $self->{'trailer'}{$k} eq 'ARRAY' ? : |
1126
|
547 |
15 |
if (defined $self->{'reservations'}{'stream_length'}) |
1132
|
520 |
13 |
if defined $page and defined $self->{'stream_page'} and $page == $self->{'current_page'} and $self->{'stream_page'} == $page |
1151
|
27 |
15 |
if (defined $page) |
1212
|
9204 |
0 |
unless $DEBUG >= $level |
1213
|
0 |
0 |
scalar @_ ? : |
1223
|
2914 |
10 |
if (defined $self->{'fh'}) { } |
1309
|
124 |
61 |
if defined $_[0][1] and ref $_[0][1] eq 'HASH' and defined $_[0][1]{'Type'} |
1311
|
134 |
51 |
if (defined $name and defined $self->{'reservations'}{$name}) { } |
|
50 |
1 |
elsif (defined $type and defined $self->{'reservations'}{$type}) { } |
1343
|
13 |
2 |
if defined $self->{'Author'} |
1344
|
0 |
15 |
if defined $self->{'Creator'} |
1345
|
13 |
2 |
if defined $self->{'Title'} |
1346
|
0 |
15 |
if defined $self->{'Subject'} |
1347
|
0 |
15 |
if defined $self->{'Keywords'} |
1349
|
0 |
15 |
if defined $self->{'CreationDate'} |
1357
|
13 |
2 |
if defined $params{'Author'} |
1359
|
0 |
15 |
if defined $params{'Creator'} |
1361
|
13 |
2 |
if defined $params{'Title'} |
1363
|
0 |
15 |
if defined $params{'Subject'} |
1365
|
0 |
15 |
if defined $params{'Keywords'} |
1367
|
0 |
15 |
if defined $params{'CreationDate'} |
1390
|
5 |
10 |
if defined $self->{'outlines'} |
1393
|
13 |
2 |
if defined $params{'PageMode'} |
1402
|
2748 |
3455 |
if ($val) { } |
1408
|
1 |
6202 |
unless ($type) |
1420
|
1 |
1 |
$val eq '0' ? : |
|
1 |
2 |
$val eq 'false' ? : |
|
1 |
3 |
$val eq 'true' ? : |
1430
|
1 |
76 |
unless defined $val |
1438
|
1 |
1127 |
unless defined $val |
1472
|
1 |
3 |
unless $type eq 'null' || $type eq 'number' and do {
1
} or $type eq 'cr' and do {
$val = "\n"
} or $type eq 'boolean' and do {
$val = $val eq 'true' ? $val : ($val eq 'false' ? $val : ($val eq '0' ? 'false' : 'true'))
} or $type eq 'verbatim' and do {
$val = "$val"
} or $type eq 'string' and do {
$val = '' unless defined $val;
$val = "($val)"
} or $type eq 'number' and do {
$val = "$val"
} or $type eq 'name' and do {
$val = '' unless defined $val;
$val = "/$val"
} or $type eq 'array' and do {
my $s = '[';
foreach my $v (@$val) {
$s .= &encode($v->[0], $v->[1]) . ' ';
};
chop $s;
$val = $s . ']'
} or $type eq 'dictionary' and do {
my $s = '<<' . &encode('cr');
foreach my $v (keys %$val) {
$s .= &encode('name', $v) . ' ';
$s .= &encode(do {
$$val{$v}
}->[0], do {
$$val{$v}
}->[1]);
$s .= &encode('cr');
};
$val = $s . '>>'
} or $type eq 'object' and do {
my $s = &encode('number', $val->[0]) . ' ' . &encode('number', $val->[1]) . ' obj';
$s .= &encode('cr');
$s .= &encode($val->[2][0], $val->[2][1]);
$s .= &encode('cr');
$val = $s . 'endobj'
} or $type eq 'ref' and do {
my $s = &encode('number', $val->[0]) . ' ' . &encode('number', $val->[1]) . ' R';
$val = $s
} or $type eq 'stream' and do {
my $data = delete $val->{'Data'};
my $s = '<<' . &encode('cr');
foreach my $v (keys %$val) {
$s .= &encode('name', $v) . ' ';
$s .= &encode(do {
$$val{$v}
}->[0], do {
$$val{$v}
}->[1]);
$s .= &encode('cr');
};
$s .= '>>' . &encode('cr') . 'stream' . &encode('cr');
$s .= $data . &encode('cr');
$val = $s . 'endstream' . &encode('cr')
} |