Here is a simple Tk example. I've just put the row-col numbers in the cells, but you could load $cells{$row}{$col}{'data'} with your spreadsheet output and use that for the text. It is also possible to change fonts, cell colors, text color, etc. When you click the png-output button, be patient, it may take a second or 2.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
use Tk::WinPhoto;
use Tk::PNG;
my $mw = tkinit;
my $width = 500;
my $height = 700;
my $canv = $mw->Canvas(width => $width, height =>$height)->pack();
#set cell size adjustment
my $x = 50;
my $y = 20;
my $rows = int( $height / $y + 1 ) - 1; #make it 0 based
my $cols = int( $width / $x + 1 ) - 1;
print "rows->$rows cols->$cols\n";
my %cells;
foreach my $row ( 0 .. $rows ) {
foreach my $col ( 0 .. $cols ) {
$cells{$row}{$col}{'rect'} = $canv->createRectangle(
$col * $x, $row * $y, $col * $x + $x, $row * $y + $y,
#-width => 1,
-outline => 'white',
);
$cells{$row}{$col}{'text'} = $canv->createText(
$col * $x + $x/2 , $row * $y + $y/2,
-text => "$row - $col",
-anchor => 'center',
-fill => 'black',
);
}
}
my $canvbutton = $mw->Button(-text=>'Canvas Capture',
-command => \&canv_capture,
)->pack;
MainLoop;
##########################################################
sub canv_capture{
my $image = $mw->Photo(-format => 'Window',
-data => oct($canv->id)
);
my $pathname = './canvas.'.time.'.png';
$image->write($pathname, -format => 'PNG');
}
##############################################################
I'm not really a human, but I play one on earth.
flash japh