liberty has asked for the wisdom of the Perl Monks concerning the following question:

I am using a template to create PDFs (thats the final product), need to create a lot; been playing with the PDF modules like PDF::API2; what are all your thoughts on the best way to do this?

Replies are listed 'Best First'.
Re: Mass PDF Creation
by mr_mischief (Monsignor) on Apr 25, 2008 at 17:47 UTC
    Like I mentioned in the CB, I typically work with PDFs using application-specific wrapper modules which utilize PDF::API2::Simple. That module offers direct access to the underlying PDF::API2 object it uses when you need it.

    The "application specific" modules can be anything from method calls for each part of a document to the back end for a template engine, depending on just what type of document I need to produce and how flexible the tool chain needs to be.

    Other options exist, as a CPAN search for "PDF" will show. Pod::Pdf, PDF::FromHTML, PDF::FromHTML::Template, HTML::HTMLDoc and Business::ReportWriter::PDF look interesting for getting PDFs from different types of templates besides just the obvious PDF::Template. I'm not sure of the status of any of them, though.

    Other more generic PDF creation tools, such as CAM::PDF, PDF::EasyPDF, Text::PDF, and PDF::Writer can be used to create PDFs.

    There are also more specialized PDF creators for different types of tasks, such as PDF::ReportWriter, PDF::Report, and even Games::Bingo::Print.

    There are tools out there to convert LaTeX and PS documents to PDF, too.

    It's quite possible there are more ways from your input to a PDF than you ever care to evaluate. Starting with what your input might be and seeing how to massage that into input and code for one of the better-maintained PDF libraries is probably a good place to start.

Re: Mass PDF Creation
by dragonchild (Archbishop) on Apr 25, 2008 at 17:10 UTC
    PDF::Template is what's on CPAN for templatized PDFs. It's a bit old and not well-supported - in fact, it's looking for a new maintainer.

    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?
Re: Mass PDF Creation
by holli (Abbot) on Apr 25, 2008 at 20:35 UTC
Re: Mass PDF Creation
by grizzley (Chaplain) on Apr 28, 2008 at 07:56 UTC