Skip Menu |

This queue is for tickets about the PDFLib CPAN distribution.

Report information
The Basics
Id: 287
Status: resolved
Priority: 0/
Queue: PDFLib

People
Owner: Nobody in particular
Requestors: aaron [...] aaronland.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.08
Fixed in: (no value)



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
Date: Thu, 14 Feb 2002 15:23:19 +0000 (GMT)
From: Matt Sergeant <matt [...] sergeant.org>
To: Guest via RT <bug-PDFLib [...] rt.cpan.org>
Subject: Re: [cpan #287] bounding boxes and new lines
On Thu, 14 Feb 2002, Guest via RT wrote: Show quoted text
> > > This message about PDFLib was sent to you by guest via rt.cpan.org > > <URL: https://rt.cpan.org/Ticket/Display.html?id=287 > > > 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. :-)
No kidding ;-) I think I've already fixed this (and a lot of other BB bugs) in CVS. If you want to try it, it's on the axkit CVS server: cvs -z3 -d :pserver:anonymous@axkit.org:/home/cvs login/co PDFLib -- <!-- Matt --> <:->Get a smart net</:->