Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Dynamic tables using PDF::Template

by dragonchild (Archbishop)
on Jan 09, 2008 at 14:20 UTC ( [id://661356]=note: print w/replies, xml ) Need Help??


in reply to Dynamic tables using PDF::Template

Wow. Two questions and two doozies. Dynamically determining column width from data is really really difficult, particularly for outputs which are paginated, dynamically formatted, and printed. It could've been fixed pretty easily, except for the fact that PDF::Template is a single-pass transformer. All the fixes require a two-pass engine and rewriting the engine just for this situation was deemed too much work for the effort.

The best solution I've found is to use percentages and keep tweaking. Alternately, you can actually have the widths be variable and calculate things in your code.

As for more permanent solutions, take a look at Excel::Template::Element::Cell::AutoSize. While it's for Excel::Template and not PDF::Template, they were written off the same engine (E::T is just a rewrite of P::T) and so the technique of adding your own elements dynamically works the same for both.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found