OT -- generating colored-text PDFs via perl
i tried
apt-get install libpdf-api2-perl
which didn't find any such module to install, of course,
so i nabbed it via "perl -MCPAM -e 'shell'" instead...
OFF TOPIC --
this is debian-land, i realize -- but i'm hoping some of you
knowledgeable folks can point me to the right group or e-list:
i'm trying to generate pdf's, using perl, outputting file-folder
labels with COLORED TEXT. (lastname teal, location blue, etc)
perl
generating pdfs
with colored text
so far i've rubbed my eyeballs over PDF::Report and PDF::API2::*
and Text::PDF and seem to have missed it. i've got the
PDF::Report::drawPieGraph to work, but the only colors are in
the slices, not in the legend text. i copied that function and
(hoping to colorize the legend text) altered it thus:
foreach my $nbr (0 .. $#perc) {
$self->addRawText($rLabels->[$nbr], $left+$colorblocksize+3,$
$pos-$colorblocksize,
# specify color, just as the manual sez:
$clr[$cnt]);
$self->shadeRect($left+1, $pos, $left+1+$colorblocksize,$
$pos-$colorblocksize, $clr[$cnt++]);$$$$
$pos-=$fontsize;
}$
to no avail. probably a bug? so i also tried the brute-force-and
-awkwardness approach:
foreach my $nbr (0 .. $#perc) {
# try a color for the following text:
$gfx->fillcolor($clr[$cnt]);
$self->addRawText($rLabels->[$nbr], $left+$colorblocksize+3,$
$pos-$colorblocksize);$
# do the fill
$gfx->fill;
$self->shadeRect($left+1, $pos, $left+1+$colorblocksize,$
$pos-$colorblocksize, $clr[$cnt++]);$$$$
$pos-=$fontsize;
}$
no good.
obviously my understanding falls short...
google.com/groups does bring up some newsgroup hits, but none
seem to pertain to coloring actual text streams.
pointers welcome.
--
I use Debian/GNU Linux version 3.0;
Linux boss 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown
DEBIAN NEWBIE TIP #76 from USM Bish <bish@nde.vsnl.net.in>
:
To SEARCH THE CONTENTS OF A TAR.GZ file without having to
extract everything:
tar -tzf file.tar.gz | grep something
Also try zcat.
Also see http://newbieDoc.sourceForge.net/ ...
Reply to: