PDF-Table
view release on metacpan or search on metacpan
INFO/Table.html view on Meta::CPAN
<p><b>Default:</b> <code>1</code> ($border_w_default)</p>
<p>The <i>border</i> is the <b>outside</b> frame around the table. It does not enter into table height or width calculations, so be sure to set your <code>x</code> and <code>w</code> settings to allow for the width of vertical borders, and your <code...
<pre> 'border_w' => 3, # border width is 3
'h_border_w' => 1, # horizontal borders will be 1, overriding 3
'v_border_w' => undef, # vertical borders will be 3, as it will
# fall back to 'border_w'</pre>
<p>Note that both borders and rules overlay the exact boundary between two cells (i.e., the centerline). That is, one half of a rule or border will overlay the adjoining cells. Rules do not expand the size of the table, although borders will (by a to...
<p><b>Deprecated names:</b> <i>border</i> (now 'border_w'), <i>horizontal_borders</i> (now 'h_border_w'), and <i>vertical_borders</i> (now 'v_border_w'); will go away in the future!</p>
<dt><a name="border_c_-_Border_color_for_all_borders."
><b>border_c</b> - Border color for all borders.</a></dt>
<dd>
<p><b>Value:</b> Color specifier as 'name' or '#rrggbb'</p>
<p><b>Default:</b> <code>'black'</code> ($fg_color_default)</p>
INFO/Table.html view on Meta::CPAN
<p><b>Default:</b> <code>1</code> (corresponding border value)</p>
<p>A <i>rule</i> is a line bordering a <i>cell</i> in the table. While it does not enter into table height or width calculations, be sure to set your <code>padding</code> settings to allow sufficient clearance of cell content, especially if you make ...
<pre> 'rule_w' => 3, # rule width is 3
'h_rule_w' => 1, # horizontal rules will be 1, overriding 3
'v_rule_w' => undef, # vertical rules will be 3, as it will
# fall back to 'rule_w'</pre>
<p>Note that both borders and rules overlay the exact boundary between two cells (i.e., the centerline). That is, one half of a rule or border will overlay the adjoining cells. Rules do not expand the size of the table. If you set particularly thick ...
<p>Cell rules inherit thickness and color from the border settings, so if you want no internal rules, you need to set</p>
<pre> 'rule_w' => 0, # no rules</pre>
<dt><a name="rule_c_-_Rule_color_for_all_rules."
><b>rule_c</b> - Rule color for all rules.</a></dt>
<dd>
<dt><a name="h_rule_c_-_Rule_color_for_horizontal_(bottom)_rules,_overriding_rule_c_for_this_usage."
lib/PDF/Table.pm view on Meta::CPAN
$row_is_odd = !$row_is_odd;
$next_top_border = 2; # dashed line
} else {
$row_idx++;
$next_top_border = 1; # solid line
}
$first_row = 0;
} # End of Row_Loop for this page, and possibly whole table
# draw bottom border on this page. first, is this very last row?
# The line overlays and hides any odd business with vertical rules
# in the last row
if (!scalar(@{$data})) { $next_top_border = 0; }
if ($ink) {
if ($gfx && $h_border_w) {
if ($next_top_border == 0) {
# last bottom border, use specified border
$gfx->linewidth($h_border_w);
} elsif ($next_top_border == 1) {
# solid thin line at start of a row
$gfx->linewidth($border_w_default);
lib/PDF/Table.pm view on Meta::CPAN
$gfx->strokecolor($border_c);
$gfx->move( $xbase-$v_border_w/2 , $cur_y );
$gfx->hline($xbase + $width + $v_border_w/2);
$gfx->stroke();
$gfx->linedash();
}
if ($gfx) {
if ($v_border_w) {
# Draw left and right table borders
# These overlay and hide any odd business with horizontal
# rules at the left or right edge
$gfx->linewidth($v_border_w);
$gfx->move( $xbase, $table_top_y);
$gfx->vline( $cur_y );
$gfx->move( $xbase + $width, $table_top_y);
$gfx->vline( $cur_y );
}
# draw all the unrendered lines
$gfx->stroke();
lib/PDF/Table.pod view on Meta::CPAN
settings to allow for the width of vertical borders, and your C<y> or C<next_y>
and C<h> or C<next_h> settings to allow for the width (thickness or height) of
the horizontal borders, especially if you make them more than a Point or two
in thickness (line width).
'border_w' => 3, # border width is 3
'h_border_w' => 1, # horizontal borders will be 1, overriding 3
'v_border_w' => undef, # vertical borders will be 3, as it will
# fall back to 'border_w'
Note that both borders and rules overlay the exact boundary between two cells
(i.e., the centerline). That is, one half of a rule or border will overlay the
adjoining cells. Rules do not expand the size of the table, although
borders will (by a total of their thickness/width). If you set particularly
thick (wide) rules, pay attention to adding some padding on the appropriate
side(s), so that valuable content is not overlaid. For cells along the outer
border, one half the width of a border will overlay the cell, so account for
this in the padding specification.
B<Deprecated names:> I<border> (now 'border_w'),
I<horizontal_borders> (now 'h_border_w'),
and I<vertical_borders> (now 'v_border_w'); will go away in the future!
=item B<border_c> - Border color for all borders.
B<Value:> Color specifier as 'name' or '#rrggbb'
lib/PDF/Table.pod view on Meta::CPAN
the rules more than a Point or two in thickness (line width). Note that a
cell only defines and draws its left and bottom rules -- the top rule is
defined in the cell or row above, and the right rule is defined in the cell
or column to the right of this one.
'rule_w' => 3, # rule width is 3
'h_rule_w' => 1, # horizontal rules will be 1, overriding 3
'v_rule_w' => undef, # vertical rules will be 3, as it will
# fall back to 'rule_w'
Note that both borders and rules overlay the exact boundary between two cells
(i.e., the centerline). That is, one half of a rule or border will overlay the
adjoining cells. Rules do not expand the size of the table. If you set
particularly thick (wide) rules, pay attention to adding some padding on the
appropriate side(s), so that valuable content is not overlaid. For cells along
the outer border, a I<border> will be drawn instead of a I<rule>.
Cell rules inherit thickness and color from the border settings, so if you want
no internal rules, you need to set
'rule_w' => 0, # no rules
lib/PDF/Table/ColumnWidth.pm view on Meta::CPAN
use List::Util qw[min max]; # core
our $VERSION = '1.007'; # VERSION
our $LAST_UPDATE = '1.003'; # manually update whenever code is changed
###################################################################
# calculate the column widths
# minimum: any specified min_w, increased to longest word in column
# maximum: largest total length of content, reduced to any spec. max_w
# maximum must be at least as large as minimum
# TBD: rules and borders? currently overlay cells. consider
# expanding h and w by width of rules and borders. would involve
# mucking with cell background fill dimensions? remember that
# rule widths could vary by cell. perhaps could just increase cell
# dimensions (and padding) by rule widths, and continue to overlay?
# expand min widths to fill to desired total width, try not to
# exceed maximum widths
# NOTE: this routine is called directly from t/PDF-Table.t
###################################################################
sub CalcColumnWidths {
my $avail_width = shift; # specified table width
my $col_min_width = shift; # content-driven min widths (longest word) and
# optional min_w
my $col_max_content = shift; # content-driven max widths
( run in 1.880 second using v1.01-cache-2.11-cpan-49f99fa48dc )