Skip Menu |

This queue is for tickets about the PDF-Report CPAN distribution.

Report information
The Basics
Id: 11274
Status: resolved
Priority: 0/
Queue: PDF-Report

People
Owner: aorr [...] cpan.org
Requestors: allard [...] byte.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.22
Fixed in: (no value)



Subject: PDF::Report does not function correctly with PDF::API2 version 0.40.x
Dear Maintainer, Please note that with the release of PDF::API2, PDF::Report has stopped functioning properly. This has been bookin as Debian bug 292622: http://bugs.debian.org/292622 The following script fails: ------------------- #!/usr/bin/perl use PDF::Report; my $text = "%TEST%"; my $pdf = new PDF::Report( PageSize => "a4" ); $pdf->newpage(1); $pdf->setAddTextPos(700, 100); $pdf->addText($text); $pdf->saveAs("test.pdf"); ------------------- The error it produces is: Can't use an undefined value as an ARRAY reference at /usr/share/perl5/PDF/Report.pm line 109. The hash, containing the dimensions of commonly used pageformats, that was previously defined in PDF::API2::Page as %pgsz is no longer properly imported or populated. Regards, Allard Hoeve
Subject: Patch for PDF::API2 0.40.* compatibility
From: Gunnar Wolf <gwolf [...] debian.org>
Hi, I have closed this bug in Debian by applying a patch sent to our BTS by Jordan Hrycaj, fixing the usage of private (and deprecated) PDF::API2's attributes in favour of its published API. It worked fine for a small test I made, although it does not mean it has been comprehensively tested: --- branches/upstream/current/Report.pm 2005-02-15 21:10:20.000000000 -0600 +++ trunk/Report.pm 2005-02-15 21:10:20.000000000 -0600 @@ -106,9 +106,9 @@ # Set the width and height of the page my ($pageWidth, $pageHeight) = - @{$PDF::API2::Page::pgsz{"\L$DEFAULTS{PageSize}"}}; + (PDF::API2::Util::page_size "\L$DEFAULTS{PageSize}") [2,3]; ($pageWidth, $pageHeight) = - @{$PDF::API2::Page::pgsz{"\L$defaults{PageSize}"}} + (PDF::API2::Util::page_size "\L$defaults{PageSize}") [2,3] if length($defaults{PageSize}); # Swap w and h if landscape @@ -160,7 +160,7 @@ # Default fonts $self->{font} = $self->{pdf}->corefont('Helvetica'); # Default font object - $self->{font}->encode('latin1'); + $self->{font}->encodeByData('latin1'); # Set the users options foreach my $key (keys %defaults) { @@ -264,8 +264,8 @@ my $txt = $self->{page}->text; $txt->font($self->{font}, $self->{size}); $txt->transform_rel(-translate => [$x, $y], -rotate => $rotate); - $txt->text_fancy($text, -color=>[$color], -underline=>$underline, - -indent=>$indent); + $txt->text($text, -color=>[$color], -underline=>$underline, + -indent=>$indent); } =item PDF::API2 Removes all space between every word in the string you pass @@ -1018,7 +1018,7 @@ sub Finish { my $self = shift; - my $callback = shift; + my $callback = shift || 'none'; my $total = $self->{page_nbr} - 1;
Version 1.30 is up-to-date with PDF::API2 0.40.xx. -Andy