Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by Eliya (Vicar)
on Nov 15, 2012 at 17:30 UTC ( #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.


Comment on Re: Set text size in table cell using PDF::Table
Select or Download Code
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
Node Status?
node history
Node Type: note [id://1004044]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (15)
As of 2015-07-02 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (40 votes), past polls