in reply to Re^3: Rotating a (PDF:::Table) Page Help!
in thread Rotating a (PDF:::Table) Page Help!

The docs have this, its similar on how this value should be passed to $pdftable->table, look at this:
my $hdr_props = { # This param could be a pdf core font or user specified TTF. # See PDF::API2 FONT METHODS for more information font => $pdf->corefont("Times", -encoding => "utf8"), font_size => 10, font_color => '#006666', bg_color => 'yellow', repeat => 1, # 1/0 eq On/Off if the header row should +be repeated to every new page };

But the problem is what to use in here if I create something like
my $code_ref = { ? => ? };

I thing that on ? above should the right parameters to be passed to "pdftable->table". And I don't know what they are or how to use this "B2-Landscape function" in order to get what I need.

Replies are listed 'Best First'.
Re^5: Rotating a (PDF:::Table) Page Help!
by Corion (Patriarch) on Mar 31, 2009 at 19:31 UTC

    That's not how code references work.

      I am following the criteria here:
      http://search.cpan.org/~omega/PDF-Table-0.9.3/lib/PDF/Table.pm

        So what part of

        the parameter 'new_page_func' must be a function reference

        makes you think that passing a hash reference to it is the right way to go forward on this?

        I looked into the source code of PDF::Table and it directly calls the new_table_func reference whenever it needs a new page:

        if(ref $arg{'new_page_func'}) { $page = &{$arg{'new_page_func'}}; } else { $page = $pdf->page; }

        ... so, if you return to my above example, and modify it as follows:

        ... new_table_func => sub { my $next_page = $pdf->page; $next_page->rotate(90); return $next_page; },

        that should be all you need. But feel free to pursue other approaches at your leisure.