PDF::FromHTML::Template::Container::Row - PDF::FromHTML::Template::Container::Row documentation


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

Index


Code Index:

NAME

Top

PDF::FromHTML::Template::Container::Row

PURPOSE

Top

To specify a row of text and provide typewriter-like carriage returns at the end.

NODE NAME

Top

ROW

INHERITANCE

Top

PDF::FromHTML::Template::Container

ATTRIBUTES

Top

* H - the height the row will consume when it is done.
* LEFT_MARGIN - If specifed, the row will start rendering here. Otherwise, it will default to the PAGEDEF's LEFT_MARGIN.

CHILDREN

Top

None

AFFECTS

Top

TEXTBOX

DEPENDENCIES

Top

None

USAGE

Top

  <row h="8">
    <textbox w="50%" justify="right" text"Hello,"/>
    <textbox w="50%" justify="left" text"World"/>
  </row>

AUTHOR

Top

Rob Kinyon (rkinyon@columbus.rr.com)

SEE ALSO

Top

PAGEDEF, TEXTBOX


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

package PDF::FromHTML::Template::Container::Row;

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);

    $context->{X} = $context->get($self, 'LEFT_MARGIN');

    return 1;
}

sub deltas
{
    my $self = shift;
    my ($context) = @_;

    return {
        X => $context->get($self, 'X') * -1 + $context->get($self, 'LEFT_MARGIN'),
        Y => -1 * $self->max_of($context, 'H'),
    };
}

sub total_of
{
    my $self = shift;
    my ($context, $attr) = @_;

    return $self->max_of($context, $attr) if $attr eq 'H';

    return $self->SUPER::total_of($context, $attr);
}

1;
__END__