Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

PDF creation with Template Toolkit

by ghenry (Vicar)
on Oct 12, 2005 at 12:09 UTC ( #499455=perlquestion: print w/ replies, xml ) Need Help??
ghenry has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I am looking for examples to make this a perfect match. I know there are some docs on this using the latex(outputType) Template Filter, but I was wondering if anyone has used any other techniques with TT that they would kindly share?
Thanks,
Gavin.

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!

Comment on PDF creation with Template Toolkit
Re: PDF creation with Template Toolkit
by pboin (Deacon) on Oct 12, 2005 at 13:39 UTC

    ghenry:

    I'm just about to start coding, but I'm excited enough about where I'm going that I figured I'd mention it.

    I've decided to use a template toolkit (Happens to be HTML::Template, but that doesn't really matter.) to generate my dynamic data. Then, to get the static side of my reports ready to merge with my dynamic data, I'm looking at PDF::Reuse. That seems really good for my particular purposes, 'cause I can off-load the form generation to any third party who's willing to help. I convert their output (from any app) to PDF, plop my template-generated data on top using XY co-ordinates, and it's off to the races...

    Don't know much about your details, but maybe this approach will be at least worth checking out.

      Hi,

      Have you seen PDF::Template?
      "PDF::Template is a PDF layout system that uses the same data structures as HTML::Template."

      It may be of some use to you.

      Hope this helps.

      Martin

        I had, and PDF::Template looks really nice, especially for the reason you indicated: it plays nice with HTML::Template. The difference for me (and I should have been more clear) is that PDF::Reuse takes an already existing PDF in. I have a very complex form with shading, boxes, logos, addresses, etc. That I just need to fill-in-the-blanks. Since that's all static, I can just punch it out in a desktop publishing package instead of having to code the pieces.

        I do appreciate the suggestion though. I kinda forgot that PDF::Template was out there...

      PDF::Reuse was my second idea after looking at PDF::API2. I was really successful with PDF::Reuse, but thought I'd find out about others using TT. PDF::API2 is cool for having absolute control over everything, but I think it's a bit much for my application.

      I found PDF::Reuse to be a very good idea, because anyone can create the PDF Templates via any app, which means you don't have to. It also takes the strain out of doing the whole PDF generation via Perl, although caching would probably play a big part in saving on that overhead. And like you said, get the data you need via any method and slap it on the existing PDF with PDF::Reuse.

      Lastly, another cool thing about PDF::Reuse it is SOOO fast!!!

      Have you played with it much? It seems to fit everything I need, but just wanted to check out TT, like I said, before I go with PDF::Reuse.

      Gavin.

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!
        Note also, the brand new PDF::APIx::Layout for PDF::API2.

        This implements markup in XML, perfect for processing with #preferred_templating_system#.

        It has only just been uploaded to cpan as a developer release, but is one to watch!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://499455]
Approved by monkfan
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2014-08-29 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls