line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Khonsu::Form; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
35
|
use parent 'Khonsu::Ra'; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
26
|
|
4
|
|
|
|
|
|
|
|
5
|
5
|
|
|
5
|
|
304
|
use PDF::API2::Basic::PDF::Utils; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
1736
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub attributes { |
8
|
4
|
|
|
4
|
0
|
180
|
my $a = shift; |
9
|
|
|
|
|
|
|
return ( |
10
|
4
|
|
|
|
|
73
|
form => { $a->RW, $a->OBJ }, |
11
|
|
|
|
|
|
|
fields => { $a->RW, $a->AR }, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub add { |
16
|
7
|
|
|
7
|
0
|
23
|
my ($self, $file, %args) = @_; |
17
|
7
|
100
|
|
|
|
41
|
return $self if $self->form; |
18
|
3
|
|
|
|
|
13
|
my $form = PDFDict(); |
19
|
3
|
|
|
|
|
72
|
$form->{NeedAppearances} = PDFBool('true'); |
20
|
3
|
|
|
|
|
57
|
$self->form($form); |
21
|
3
|
|
|
|
|
39
|
$file->onsave('form', 'end'); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub end { |
25
|
3
|
|
|
3
|
0
|
13
|
my ($self, $file) = @_; |
26
|
3
|
|
|
|
|
10
|
$self->form->{Fields} = PDFArray(@{$self->fields}); |
|
3
|
|
|
|
|
18
|
|
27
|
3
|
|
|
|
|
17
|
$file->pdf->{catalog}->{AcroForm} = $self->form; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub add_to_fields { |
31
|
7
|
|
|
7
|
0
|
23
|
my ($self, $file, $field) = @_; |
32
|
7
|
|
|
|
|
32
|
$self->add($file); |
33
|
7
|
|
|
|
|
62
|
my $fields = $self->fields; |
34
|
7
|
|
|
|
|
15
|
push @{$fields}, $field; |
|
7
|
|
|
|
|
19
|
|
35
|
7
|
|
|
|
|
32
|
return $self->fields($fields); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |