[Catalyst] PDF creation in Catalyst?

Kirby Krueger kirbykr at u.washington.edu
Wed Oct 22 19:08:45 BST 2008


If you go to catalystframework.org, it says on the main page:

	And in case you want PNG or PDF output, you'll need just a few lines...

Can someone give me those few lines? :-)

Somewhat less snippishly, I've been trying to figure out the state of  
PDF generation from Catalyst.  I don't need to do anything super fancy  
- mostly get a report so it can print on paper that's perforated into  
thirds, without worrying about browsers, telling users how to turn off  
browser print header/footer lines, and the like.  I've seen several  
options:

PDF::Template, based on HTML::Template.  The reasons I'm not thrilled  
about this are: terrible lack of documentation, the original  
maintainers giving up on the project and calling it a mess, versions  
being rolled back - the google footprint of this project shows a lot  
of internal chaos.  And I'm using Template Toolkit as my HTML  
generation template, so I'm not thrilled to mix in a different format.

PDF::ReportWriter.  This looks like it's maintained, under active  
development, and has excellent documentation.  Anyone heard of this?   
It's not mentioned in the usual places like perlmonks.  And the design  
really forces you to learn more about PDF than I ideally want to.

Use something external.  I found an old thread from this mailing list  
from 2006, where people mentioned htmldoc.  However, with this  
approach I'm not sure I'll get the small level of control I want (to  
verify that page breaks are in the right place, really.)  It does let  
me keep using TT, which I like.  (Other people mentioned Latex, which  
I don't really want to learn in the time I have available.  The thread  
is: http://www.gossamer-threads.com/lists/catalyst/users/8028,  
actually.)

I'm a bit surprised that there's no Catalyst::View::Something::PDF by  
now, which makes me worry that it's hard.  Most days I'd be happy to  
look into this, but I'm under the scheduling gun right now in a fairly  
panic-inducing way, so quick and dirty is unusually appealing.

I don't need to create PDF files for distribution, just something  
printable with more layout control than HTML is willing to give me.   
Maybe PDF is a rabbit hole, and someone else has a bright idea?

Thanks for any advice,

Kirby Krueger, University of Washington



More information about the Catalyst mailing list