SmugX has asked for the wisdom of the Perl Monks concerning the following question:
I have a requirement to produce mail merges with data in a "hierarchical" format - e.g. printing letters to multiple customers that have ordered multiple photographs, and perhaps have ordered multiple albums that contain multiple photographs ... the result maybe something like this:
My first thought was to put the data into XML, and use Template Toolkit to render the result. The problem is that the result will be paper-based, so HTML isn't an ideal output format. I see that I could go through TT, via LaTex to PDF or Postscript, but I ideally wanted to be able to hand over the letter for less techy people to amend, and LaTex didn't seem ideal for that. (The users are used to software like MS Word and Adobe Acrobat ...)Dear Bob A, Here are details on the photos you've ordered: Picture 1 (8"x6") Picture 2 (8"x6") Picture 3 (10"x8") Prints in a 10"x8" Red Album ------------------------------- Picture 4, Picture 5, Picture 6 [repeat etc.] Yours, Bob B
So I then wondered if I could get a PDF template knocked up, perhaps embedding Template-Toolkit code on the page, and then I could use with PDF::API2 to extract the text, parse with TT, replace the text and render a new PDF. However, extracting the text that exists in a PDF seems to be difficult - I can't find any example code anywhere.
So this is where I've got. Does anyone have any pointers to finish off any of my lines of enquiry, or alternatively any completely different solutions that may meet my needs? (I have no desperate desire to write this myself if someone's already done it for me! :))
Many thanks for any advice, Neil.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pointers on an XML mail merge solution?
by idsfa (Vicar) on May 12, 2004 at 15:00 UTC | |
by SmugX (Beadle) on May 12, 2004 at 15:38 UTC | |
by idsfa (Vicar) on May 12, 2004 at 15:52 UTC | |
by SmugX (Beadle) on May 12, 2004 at 16:11 UTC | |
|
Re: Pointers on an XML mail merge solution?
by benrwebb (Scribe) on May 12, 2004 at 15:43 UTC | |
by SmugX (Beadle) on May 12, 2004 at 15:56 UTC |