| 1 | package Khonsu::Form; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use parent 'Khonsu::Ra'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 3 | ▶ | use PDF::API2::Basic::PDF::Utils; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | sub attributes { | ||||||||||
| 8 | 2 | ▶ | my $a = shift; | ||||||||
|
Subroutine
attributes: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 9 | return ( | ||||||||||
| 10 | 2 | form => { $a->RW, $a->OBJ }, | |||||||||
| 11 | fields => { $a->RW, $a->AR }, | ||||||||||
| 12 | ); | ||||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | sub add { | ||||||||||
| 16 | 1 | ▶ | my ($self, $file, %args) = @_; | ||||||||
|
Subroutine
add: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 17 | 1 | ▶ | return $self if $self->form; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 1 | my $form = PDFDict(); | |||||||||
| 19 | 1 | $form->{NeedAppearances} = PDFBool('true'); | |||||||||
| 20 | 1 | $self->form($form); | |||||||||
| 21 | 1 | $file->onsave('form', 'end'); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | sub end { | ||||||||||
| 25 | 1 | ▶ | my ($self, $file) = @_; | ||||||||
|
Subroutine
end: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 26 | 1 | $self->form->{Fields} = PDFArray(@{$self->fields}); | |||||||||
| 27 | 1 | $file->pdf->{catalog}->{AcroForm} = $self->form; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | sub add_to_fields { | ||||||||||
| 31 | 1 | ▶ | my ($self, $file, $field) = @_; | ||||||||
|
Subroutine
add_to_fields: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 32 | 1 | $self->add($file); | |||||||||
| 33 | 1 | my $fields = $self->fields; | |||||||||
| 34 | 1 | push @{$fields}, $field; | |||||||||
| 35 | 1 | return $self->fields($fields); | |||||||||
| 36 | |||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 3 | 1; | |||||||||