Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PDF-Table CPAN distribution.

Report information
The Basics
Id: 79883
Status: resolved
Priority: 0/
Queue: PDF-Table

People
Owner: OMEGA [...] cpan.org
Requestors: cpan [...] iijo.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: patch to turn on/off horizontal and vertical borders
Hi I have a patch for a new feature. I added 2 new options 'horizontal_borders' and 'vertical_borders'. They allow you to toggle on/off horizontal/vertical borders. (As you might have guessed.) Thanks for writing this library! It would be awesome if you put it on github. :)
Subject: PDF-Table.patch
diff --git a/lib/PDF/Table.pm b/lib/PDF/Table.pm index 6805dac..86e385c 100644 --- a/lib/PDF/Table.pm +++ b/lib/PDF/Table.pm @@ -279,14 +279,20 @@ sub table # Other Parameters check #===================================== - my $lead = $arg{'lead' } || $fnt_size; - my $pad_left = $arg{'padding_left' } || $arg{'padding'} || 0; - my $pad_right = $arg{'padding_right' } || $arg{'padding'} || 0; - my $pad_top = $arg{'padding_top' } || $arg{'padding'} || 0; - my $pad_bot = $arg{'padding_bottom' } || $arg{'padding'} || 0; - my $pad_w = $pad_left + $pad_right; - my $pad_h = $pad_top + $pad_bot ; - my $line_w = defined $arg{'border'} ? $arg{'border'} : 1 ; + my $lead = $arg{'lead' } || $fnt_size; + my $pad_left = $arg{'padding_left' } || $arg{'padding'} || 0; + my $pad_right = $arg{'padding_right' } || $arg{'padding'} || 0; + my $pad_top = $arg{'padding_top' } || $arg{'padding'} || 0; + my $pad_bot = $arg{'padding_bottom' } || $arg{'padding'} || 0; + my $pad_w = $pad_left + $pad_right; + my $pad_h = $pad_top + $pad_bot ; + my $line_w = defined $arg{'border'} ? $arg{'border'} : 1 ; + my $horiz_borders = defined $arg{'horizontal_borders'} + ? $arg{'horizontal_borders'} + : $line_w; + my $vert_borders = defined $arg{'vertical_borders'} + ? $arg{'vertical_borders'} + : $line_w; my $background_color_even = $arg{'background_color_even' } || $arg{'background_color'} || undef; my $background_color_odd = $arg{'background_color_odd' } || $arg{'background_color'} || undef; @@ -460,8 +466,11 @@ sub table $gfx->linewidth($line_w); # Draw the top line - $gfx->move( $xbase , $cur_y ); - $gfx->hline($xbase + $width ); + if ($horiz_borders) + { + $gfx->move( $xbase , $cur_y ); + $gfx->hline($xbase + $width ); + } } else { @@ -624,7 +633,7 @@ sub table $cur_y -= $row_h; $row_h = $min_row_h; - if ($gfx) + if ($gfx && $horiz_borders) { $gfx->move( $xbase , $cur_y ); $gfx->hline( $xbase + $width ); @@ -637,15 +646,19 @@ sub table if ($gfx) { # Draw vertical lines - $gfx->move( $xbase, $table_top_y); - $gfx->vline( $cur_y ); - my $cur_x = $xbase; - for( my $j = 0; $j < scalar(@$record); $j++ ) - { - $cur_x += $calc_column_widths->[$j]; - $gfx->move( $cur_x, $table_top_y ); - $gfx->vline( $cur_y ); - } + if ($vert_borders) + { + $gfx->move( $xbase, $table_top_y); + $gfx->vline( $cur_y ); + my $cur_x = $xbase; + for( my $j = 0; $j < scalar(@$record); $j++ ) + { + $cur_x += $calc_column_widths->[$j]; + $gfx->move( $cur_x, $table_top_y ); + $gfx->vline( $cur_y ); + } + } + # ACTUALLY draw all the lines $gfx->fillcolor( $border_color); $gfx->stroke;
Subject: Re: [rt.cpan.org #79883] patch to turn on/off horizontal and vertical borders
Date: Thu, 27 Sep 2012 12:57:39 -0400
To: Eric D Johnson via RT <bug-PDF-Table [...] rt.cpan.org>
From: John Bazik <jsb [...] cs.brown.edu>
On Thu, Sep 27, 2012 at 12:52:05PM -0400, Eric D Johnson via RT wrote: Show quoted text
> Hi I have a patch for a new feature. I added 2 new options > 'horizontal_borders' and 'vertical_borders'. They allow you to toggle > on/off horizontal/vertical borders. (As you might have guessed.)
Thanks - I have a few bugs/patches I need to review. I'll try to find some time soon. John
On Thu Sep 27 12:57:47 2012, jsb@cs.brown.edu wrote: Show quoted text
> On Thu, Sep 27, 2012 at 12:52:05PM -0400, Eric D Johnson via RT wrote:
> > Hi I have a patch for a new feature. I added 2 new options > > 'horizontal_borders' and 'vertical_borders'. They allow you to
toggle Show quoted text
> > on/off horizontal/vertical borders. (As you might have guessed.)
> > Thanks - I have a few bugs/patches I need to review. I'll try to find > some time soon. > > John
Thanks John. I know it can be hard to find time to work on this stuff. I'm using this code at work and I would feel better if I had the change merged into the official cpan version. Anything I can do to help?
Subject: Re: [rt.cpan.org #79883] patch to turn on/off horizontal and vertical borders
Date: Mon, 15 Oct 2012 12:11:51 +0300
To: bug-PDF-Table [...] rt.cpan.org
From: Desislav Kamenov <desi [...] zendor.eu>
Hi Eric, If you send me a patch, i will review it and issue a new version on CPAN. Also if you have time to spend, I (probably) can add you as a maintainer. On 15 Oct 2012, at 11:21, Eric D Johnson via RT wrote: Show quoted text
> Queue: PDF-Table > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=79883 > > > On Thu Sep 27 12:57:47 2012, jsb@cs.brown.edu wrote:
>> On Thu, Sep 27, 2012 at 12:52:05PM -0400, Eric D Johnson via RT wrote:
>>> Hi I have a patch for a new feature. I added 2 new options >>> 'horizontal_borders' and 'vertical_borders'. They allow you to
> toggle
>>> on/off horizontal/vertical borders. (As you might have guessed.)
>> >> Thanks - I have a few bugs/patches I need to review. I'll try to find >> some time soon. >> >> John
> > Thanks John. I know it can be hard to find time to work on this stuff. > I'm using this code at work and I would feel better if I had the change > merged into the official cpan version. Anything I can do to help?
I've replied from my email client and didn't see the patch. Sorry. On 2012-10-15 12:12:08, desi@zendor.eu wrote: Show quoted text
> Hi Eric, > > If you send me a patch, i will review it and issue a new version on CPAN.
-- De si?
On Mon Oct 15 05:28:16 2012, OMEGA wrote: Show quoted text
> I've replied from my email client and didn't see the patch. Sorry.
No worries. I'd be happy to be added as a co-maintainer. My PAUSE id is KABLAMO. Oh, I see there are two of you already. :) Is there a public repository for the code right now? If not would there be any objection to me creating one on github? I could add you both as collaborators. That might make it slightly easier to apply patches in the future.
I was thinking to do the same but on bitbucket.org so feel free to do it on github.com My github id is: kamenov On 2012-10-15 13:03:30, kablamo wrote: Show quoted text
> On Mon Oct 15 05:28:16 2012, OMEGA wrote:
> > I've replied from my email client and didn't see the patch. Sorry.
> > No worries. I'd be happy to be added as a co-maintainer. My PAUSE id is > KABLAMO. Oh, I see there are two of you already. :) > > Is there a public repository for the code right now? If not would there > be any objection to me creating one on github? I could add you both as > collaborators. That might make it slightly easier to apply patches in > the future.
-- -- De si?
Subject: Re: [rt.cpan.org #79883] patch to turn on/off horizontal and vertical borders
Date: Mon, 15 Oct 2012 09:58:32 -0400
To: Desislav Kamenov via RT <bug-PDF-Table [...] rt.cpan.org>
From: John Bazik <jsb [...] cs.brown.edu>
Hi guys - sorry for the delay on those patches. I've been flat-out for a while now. I've also been meaning to put the code up on github, that's a good idea. John
Hi Guys, I've created a repo on Github and here is the URL https://github.com/kamenov/PDF-Table There are a few forks but I noted that this is the official repo. I'll include the patches from all open tickets till the end of the week. I'll give you write permissions if you send me you github ids. -- De si?
On Wed Oct 17 10:37:15 2012, OMEGA wrote: Show quoted text
> Hi Guys, > > I've created a repo on Github and here is the URL > > https://github.com/kamenov/PDF-Table > > There are a few forks but I noted that this is the official repo. > I'll include the patches from all open tickets till the end of the
week. Show quoted text
> I'll give you write permissions if you send me you github ids. > -- > De si?
Cool. Thanks! My github username is kablamo.
Subject: Re: [rt.cpan.org #79883] patch to turn on/off horizontal and vertical borders
Date: Thu, 18 Oct 2012 12:08:23 +0300
To: bug-PDF-Table [...] rt.cpan.org
From: Desislav Kamenov <desi [...] zendor.eu>
Ahaaa, so the fork of 0.9.5 is yours :) I've added you as a collaborator. On 18 Oct 2012, at 11:13, Eric D Johnson via RT wrote: Show quoted text
> Queue: PDF-Table > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=79883 > > > On Wed Oct 17 10:37:15 2012, OMEGA wrote:
>> Hi Guys, >> >> I've created a repo on Github and here is the URL >> >> https://github.com/kamenov/PDF-Table >> >> There are a few forks but I noted that this is the official repo. >> I'll include the patches from all open tickets till the end of the
> week.
>> I'll give you write permissions if you send me you github ids. >> -- >> De si?
> > Cool. Thanks! My github username is kablamo.
Added in github as part of version 0.9.6 https://github.com/kamenov/PDF- Table/commit/680f664d659b055394cc8f397c3d6f460c86611c -- De si?
0.9.6 released -- De si?