lib/PDF/FromHTML/Template/Container/PdfTemplate.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 37 CC 3 SCAR 13.3
CC
3
Cov
0%
new
6.0
render
6.0
BEGIN
2.0
CRAP 3.8
1 package PDF::FromHTML::Template::Container::PdfTemplate;
2  
3 use strict;
4  
5 BEGIN {
6 use vars qw(@ISA);
7 @ISA = qw(PDF::FromHTML::Template::Container);
8  
9 use PDF::FromHTML::Template::Container;
10 }
11  
12 sub new {
13 my $class = shift;
14 my $self = $class->SUPER::new(@_);
15  
16 # The default color is black
17 $self->{COLOR} = '0,0,0' unless exists $self->{COLOR};
18  
19 return $self;
20 }
21  
22 sub should_render {
23 # my $self = shift;
24 # my ($context) = @_;
25  
26 return 1;
27 }
28  
29 sub render {
30 my $self = shift;
31 my ($context) = @_;
32  
33 $self->enter_scope($context);
34  
35 my $child_success = $self->SUPER::render($context)
36 if $self->should_render($context);
37  
38 $self->exit_scope($context);
39  
40 return $child_success;
41 }
42  
43 #sub preprocess {
44 # my $self = shift;
45 # my ($context) = @_;
46 #
47 # $self->enter_scope($context);
48 #
49 # $context->{PARAM_MAP}[0]{__LAST_PAGE__} = 0;
50 # unless ($context->get($self, 'NOLASTPAGE')) {
51 # my $old_PDF = $context->{PDF};
52 #
53 # my $p = PDF::Writer->new;
54 # $p->open() or die "Could not open buffer.", $/;
55 #
56 # $context->{PDF} = $p;
57 #
58 # $context->{CALC_LAST_PAGE} = 1;
59 # $self->SUPER::render($context);
60 # $context->{CALC_LAST_PAGE} = 0;
61 #
62 # $p->close;
63 # $self->reset;
64 # $context->delete_fonts;
65 #
66 # $context->{PDF} = $old_PDF;
67 # $context->{PARAM_MAP}[0]{__LAST_PAGE__} = $context->{PARAM_MAP}[0]{__PAGE__} - 1;
68 # $context->{PARAM_MAP}[0]{__PAGE__} = 1;
69 # $context->{PARAM_MAP}[0]{__PAGEDEF__} = 0;
70 # }
71 #
72 # $self->exit_scope($context, 1);
73 #
74 # return 1;
75 #}
76  
77 1;
78 __END__