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

Re: PDF creation with Template Toolkit

by pboin (Deacon)
on Oct 12, 2005 at 13:39 UTC ( #499480=note: print w/replies, xml ) Need Help??

in reply to PDF creation with Template Toolkit


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.

Replies are listed 'Best First'.
Re^2: PDF creation with Template Toolkit
by marto (Cardinal) on Oct 12, 2005 at 14:16 UTC

    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.


      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...

Re^2: PDF creation with Template Toolkit
by ghenry (Vicar) on Oct 12, 2005 at 14:21 UTC

    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.


    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a 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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2023-02-07 09:06 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (38 votes). Check out past polls.