Subject: | bounding boxes and new lines |
The print method for bounding boxes where the wrap attribute is false is not respecting the position set the object constructor.
If you do...
my $bb = $pdf->new_bounding_box(x=>20,y=>270,h=>225,w=>421,wrap=>0);
$bb->print("Hello\nworld");
...the text is printed at postion 0,0 and you only ever see the first "line" since all the others get printed off the page.
In an effort to just make sure I understood what was going on, I fashioned a sledge-hammer like workaround by setting the wrap attribute, calling the $bb->print method again and then unsetting the wrap attribute...
my $line = shift(@lines);
$self->{'wrap'} = 1;
#$self->SUPER::print($line);
#$self->SUPER::print_line("");
$self->print($line);
$self->print_line("");
$self->{'wrap'} = 0;
# repeat for $last
...which fixes the problem, albeit at the cost of speed and elegance. :-)
PDFLib 0.8
Perl 5.6.1
FreeBSD 4.4 #STABLE