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

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.