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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
package PDF::FromHTML::Template::Container::Always;
use strict;
BEGIN {
use vars qw(@ISA);
@ISA = qw(PDF::FromHTML::Template::Container);
use PDF::FromHTML::Template::Container;
}
sub enter_scope
{
my $self = shift;
my ($context) = @_;
$self->SUPER::enter_scope($context);
$self->{OLD_TRIP} = $context->pagebreak_tripped;
$context->reset_pagebreak;
return 1;
}
sub exit_scope
{
my $self = shift;
my ($context) = @_;
$context->pagebreak_tripped($self->{OLD_TRIP});
$self->reset;
return $self->SUPER::exit_scope($context);
}
sub mark_as_rendered {}
1;
__END__
=head1 NAME
PDF::FromHTML::Template::Container::Always - Any child of this node will always render on every page
=head1 DESCRIPTION
To require that any child of this node will always render on every page.
Normally, a node will not render on a given page if a node before it has
triggered a pagebreak. ALWAYS nodes will always render on every page.
Primarily, this is used as a base class for HEADER and FOOTER. However, you
might want something to always render on every page outside the header and
footer areas. For example, a watermark.
=head1 NODE NAME
ALWAYS
=head1 INHERITANCE
PDF::FromHTML::Template::Container
=head1 ATTRIBUTES
None
=head1 CHILDREN
PDF::FromHTML::Template::Container::Margin
PDF::FromHTML::Template::Container::Header
PDF::FromHTML::Template::Container::Footer
=head1 AFFECTS
Nothing
=head1 DEPENDENCIES
None
=head1 USAGE
<always>
... Children will render on every page ...
</always>
=head1 AUTHOR
Rob Kinyon (rkinyon@columbus.rr.com)
=head1 SEE ALSO
HEADER, FOOTER
=cut
|