PierreForget has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I made a PDF document on one of my servers with a main Table pages for filling tables with data, and made another page at the end to put all the summaries.
I did that with:
main_table($pdf, $some_data);
main_table2($pdf, $some_data); #using newpage2() and using footer2() to fill the summaries
and not using the some_data on the last page
It's working on this server with PDF::API2::Page version 2.023 and with PDF::Table version 0.9.7
You can see the dummy result here:
http://www.st-donat.com/pdf/formulaireassurance2.pdf
On another server with PDF::API2::Page version 2.033 and with PDF::Table version 0.10.0
It simply doesn't work and I get the message: Error: Invalid data received
From the code, I can see:
croak "Error: Invalid data received." unless ((ref($data) eq 'ARRAY') && scalar(@$data));
Which means that the $data is either not an array or not a scalar
If I put a stop in the code to get the value of $data, I get:
ARRAY(0x241c448)
Here is the part of the code that causes the problem (part of the main_table2 code):
$pdftable->table( # required params : détermine les rangées et colonnes du table +au $pdf, $page, $data, x => 80, w => 460, start_y => 490, # 550 next_y => 490, start_h => 120, next_h => 120, # some optional params padding => 5, padding_right => 5, font => $pdf->corefont("Helvetica", -encoding => "ut +f8"), font_size => 9, background_color_odd => "#EEEEEE", background_color_even => "#FFFFFF", #cell background color for + even rows header_props => $hdr_props, column_props => $col_props, new_page_func => \&newpage, # as defined above cell_render_hook => sub { # this is our newly introduced ca +llback function my ($page, $row, $col, $x, $y, $w, $h) = @_; }, );
Any way I can get a better way of seeing the variables to find the problem?
Thanks for the help (I use Perlmonks a lot to debug my Perl scripts and it's been very useful, but this one is a bugger...)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PDF::Table last page
by huck (Prior) on Apr 16, 2018 at 02:41 UTC | |
by PierreForget (Acolyte) on Apr 16, 2018 at 14:21 UTC | |
|
Re: PDF::Table last page
by vr (Curate) on Apr 16, 2018 at 16:48 UTC |