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


In reply to PDF::Table last page by PierreForget

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.