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: 40433
Status: resolved
Priority: 0/
Queue: PDF-Table

People
Owner: jbazik [...] cpan.org
Requestors: andre_vieth [...] yahoo.de
Cc:
AdminCc:

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



Subject: font color #FFFFFF after using PDF-Table
have to set font color black after using pdf-table (and writing more code based on pdf::api2): $txt->fillcolor('#000000'); otherwise, text is invisible on white background suppose the problem can not be found in my script
From: andre_vieth [...] yahoo.de
### CODE #!/usr/local/bin/perl use PDF::API2; use PDF::Table; my $pdftable = new PDF::Table; my $pdf = PDF::API2->new(-file => "forwardever.pdf"); $pdf->mediabox(595,842); my $page = $pdf->page; ############################################# my $col_props = [ { min_w => 40, # Minimum column width. justify => 'left', # One of left|right , font => $pdf->corefont("Courier", -encoding => "latin1"), font_size => 10, font_color=> 'black', background_color => '#FFFFFF', }, { min_w => 70, justify => 'left', font => $pdf->corefont("Courier", -encoding => "latin1"), font_size => 10, font_color=> 'black', background_color => '#FFFFFF', }, { min_w => 300, justify => 'left', font => $pdf->corefont("Courier", -encoding => "latin1"), font_size => 10, font_color=> 'black', background_color => '#FFFFFF', }, { min_w => 120, justify => 'left', font => $pdf->corefont("Courier", -encoding => "latin1"), font_size => 10, font_color=> 'black', background_color => '#FFFFFF', }, ]; ############################################# my $hdr_props = { # This param could be a pdf core font or user specified TTF. # See PDF::API2 FONT METHODS for more information font => $pdf->corefont("Courier", -encoding => "utf8"), font_size => 10, font_color => '#000000', bg_color => '#DDDDDD', repeat => 1, # 1/0 eq On/Off if the header row should be repeated to every new page }; ############################################# my @some_data = (); my $testaaa = [ "1.", "2.", "3.", "4." ]; push (@some_data,$testaaa); ############################################# my $testaaa = [ "", "", "", "" ]; push (@some_data,$testaaa); my $testaaa = [ "", "", "3:", $test.' 4' ]; push (@some_data,$testaaa); ############################################# my $some_data =\@some_data; ############################################# $left_edge_of_table = 50; ############################################# my ($end_page, $pages_spanned, $table_bot_y) = $pdftable->table( # required params $pdf, $page, $some_data, x => $left_edge_of_table, w => 530, start_y => 800, next_y => 750, start_h => 800, next_h => 700, # some optional params border_color => '#FFFFFF', padding => 3, padding_right => 3, column_props => $col_props, # see section COLUMN PROPERTIES header_props => $hdr_props, # see section HEADER ROW PROPERTIES max_word_length=> 40, ); ############################################# my $fnt1 = $pdf->corefont('Courier',-encoding => 'latin1'); my $txt = $page->text; $txt->font($fnt1, 10); ### $txt->fillcolor('#000000'); ### !!!!!!!!!!!!!!!!!!!!!!!!!!!!! $txt->translate(575,30); $txt->text_right('TEST'); $pdf->save; $pdf->end(); 1;
I was able to reproduce this problem, but I'm not sure I can or should fix it. I traced PDF::Table's calls to PDF::API2, and, yes, with your script, the last fillcolor call sets white - the border color requested in your script. PDF::API2 seems to lack any kind of context or encapsulation, so perhaps it makes no sense to expect the default fillcolor to remain set after a series of PDF::API2 calls. In other words, perhaps you *do* need to explicitely set the fillcolor. This ticket is several years old, so I don't know if you even care about this still, so I'm going to resolve it. Feel free to reopen the ticket by replying to this message if you think I'm wrong about that. John