Works for me:
#!/usr/bin/env perl use 5.012; use warnings; use PDF::API2; use PDF::Table; my $pdftable = new PDF::Table; my $pdf = new PDF::API2(-file => 'test.pdf'); my $page = $pdf->page; # Table data, two columns my $scalar_song = [ [ '$ Sigils to the left of me', 'Arrows to the right ->' ], [ '$self->here', 'Stuck in the \[] with you' ] ]; my $col_props = [ { font => $pdf->corefont("Courier-Bold"), width => 250, font_color => 'blue', },{ font => $pdf->corefont("Courier-Bold"), width => 250, justify => 'right', font_color => 'green', } ]; $pdftable->table($pdf, $page, $scalar_song, -column_props => $col_props, -start_y => 750, -start_h => 300, -padding => 10, -x => 50, ); $pdf->saveas();
This generated a .pdf that had two columns of equal width, with the expected font, color, and justification settings. From what I can tell, PDF::Table seems to like leading hyphens on its top-level call, but not the column_props, but the examples in the documentation don't reflect that. Perhaps that is the issue?
In reply to Re: PDF::Table seems to ignore column properties when there are but two columns
by rjt
in thread PDF::Table seems to ignore column properties when there are but two columns
by ted.byers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |