I am making a rtf file that has multiple tables, which I can easily do,
my problem is I am not sure how to make the cell background color
different than default white, I tried making on in word and seeing if I
could find the RTF code but couldn't find that either. And if it is
possible to round the corners of the table.

Here is what I have thus far for the table script:
#!/usr/bin/perl

use strict;
use RTF::Writer;

my $fh = RTF::Writer->new_to_file("rtfTemplate.rtf");
                   $fh->prolog(  
                                                        fonts =>
['Arial', ],
                                                        colors => [
                                                           undef,
# color 0 == black
                                                           [255,0,0],
# color 1 == red
                                                           [0,128,0],
# color 2 == green
                                                           [0,0,255],
# color 3 == blue
                                                           [255,255,0],
# color 4 == yellow
        
[255,255,255],# color 5 == white
        
[200,200,200],# color 6 == light gray
                                                          ],);

my $iMarginLeftInches = my $iMarginRightInches = 500;
    my $iMarginTop = 500;
    # Need bigger bottom margin for footer to fit:
    my $iMarginBottom = 500;
    my $iMarginLeft = $iMarginLeftInches;
    my $iMarginRight = $iMarginRightInches;
    eval "\$fh->Margt$iMarginTop";
    eval "\$fh->Margl$iMarginLeft";
    eval "\$fh->Margr$iMarginRight";
    eval "\$fh->Margb$iMarginBottom";

my $tableVal = [1500,1900,1900, 1500];
        my @tableData = (
                [\'\cb2 this', "that", 'jhsdfhjsa', 'thing'],
                ["that", "this", 'kjhsadfh', 'ben'],
                ["me", "none", 'slhdfjhsf', 'prat'],
                );
        &table($tableVal, @tableData); ## calls the table function which
uses the array for values


$fh->close;

sub table(){
                my($localVal, @localData) = @_;
                my $decl = RTF::Writer::TableRowDecl->new('widths' =>
$localVal );
                                $fh->row($decl, @$_) for @localData;  
           
         }


Any help would be great,

Ben Eagle
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to