Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Set text size in table cell using PDF::Table

by Eliya (Vicar)
on Nov 15, 2012 at 17:30 UTC ( [id://1004044]=note: print w/replies, xml ) Need Help??


in reply to Set text size in table cell using PDF::Table

Works for me with the current version of PDF::Table (0.9.6)  -  but not with an older version (0.9.3).

Also, note that $pdf->corefont("Helvetica", -encoding => "utf8") creates and embeds a font instance every time you make that call.  I.e., an optmization would be to create the font object just once

my $helvetica = $pdf->corefont("Helvetica", -encoding => "utf8");

and then just pass the same reference to the individual cells

... $cell_props->[$j]->[$k] = { font => $helvetica, font_size => 15, background_color => '#FFCA00', # font_color => '#fD4D4D', # justify => "left", }; ...

This cuts down the PDF size for the sample code from 290k to 9k.

Replies are listed 'Best First'.
Re^2: Set text size in table cell using PDF::Table
by Anonymous Monk on Nov 15, 2012 at 18:05 UTC
    Thank you that worked, I updated to the newer version.I just need to figured it out how to add the line thing for the subtotals, thanks!
Re^2: Set text size in table cell using PDF::Table
by Anonymous Monk on Nov 16, 2012 at 16:39 UTC
    Hi there, I am doing something similar and have a question. Is it possible using the same similar code here to do "colspan", for a sub header for example. Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1004044]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-25 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found