PDF::FromHTML::Template::Container::Always - PDF::FromHTML::Template::Container::Always documentation


PDF-FromHTML documentation Contained in the PDF-FromHTML distribution.

Index


Code Index:

NAME

Top

PDF::FromHTML::Template::Container::Always

PURPOSE

Top

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.

NODE NAME

Top

ALWAYS

INHERITANCE

Top

PDF::FromHTML::Template::Container

ATTRIBUTES

Top

None

CHILDREN

Top

PDF::FromHTML::Template::Container::Margin

PDF::FromHTML::Template::Container::Header PDF::FromHTML::Template::Container::Footer

AFFECTS

Top

Nothing

DEPENDENCIES

Top

None

USAGE

Top

  <always>
    ... Children will render on every page ...
  </always>

AUTHOR

Top

Rob Kinyon (rkinyon@columbus.rr.com)

SEE ALSO

Top

HEADER, FOOTER


PDF-FromHTML documentation Contained in the PDF-FromHTML distribution.

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__