[Melbourne-pm] PDF::API2

Kahlil Hodgson kahlil.hodgson at dealmax.com.au
Tue Mar 19 16:55:50 PDT 2013


On 20/03/13 07:33, greg.george at orica.com wrote:
> I have also used CAM::PDF - PDF manipulation library  with good sucess

Just read the perldoc and CAM::PDF looks very cool.  Think I'll be 
giving that whirl next week. Noticed the following right at the end of 
the doc:

"$doc->changeString($object, $hashref)

     Alter all instances of a given string. The hashref is a dictionary 
of from-string and to-string. If the from-string looks like regex(...) 
then it is interpreted as a Perl regular expression and is eval'ed. 
Otherwise the search-and-replace is literal."

So it looks like CAM::PDF can be used on, say, a template PDF created 
with libreoffice with complex/structured placeholder strings.

Another PDF creation module that I've used with a lot of success is 
PDF::Haru.  This is a simple wrapper around libharu
(open source written in C) which you may want to consider if 
speed/memory is an issue.  Its no free lunch though -- you still have to 
get your head around how PDF documents are structured and how the model 
corresponds to the visual representation.

K

-- 
Kahlil (Kal) Hodgson                       GPG: C9A02289
Head of Technology                         (m) +61 (0) 4 2573 0382
DealMax Pty Ltd                            (w) +61 (0) 3 9008 5281

Suite 1415
401 Docklands Drive
Docklands VIC 3008 Australia

"All parts should go together without forcing.  You must remember that
the parts you are reassembling were disassembled by you.  Therefore,
if you can't get them together again, there must be a reason.  By all
means, do not use a hammer."  -- IBM maintenance manual, 1925



More information about the Melbourne-pm mailing list