in reply to PDF::Table seems to ignore column properties when there are but two columns
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?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: PDF::Table seems to ignore column properties when there are but two columns
by ted.byers (Monk) on Jul 10, 2013 at 02:31 UTC | |
by ted.byers (Monk) on Jul 10, 2013 at 14:56 UTC | |
by poj (Abbot) on Jul 10, 2013 at 18:11 UTC | |
by ted.byers (Monk) on Jul 10, 2013 at 20:13 UTC |
In Section
Seekers of Perl Wisdom