[sf-perl] "Printer Friendly" versions - PDF?

Garth Webb garth at perijove.com
Wed Jul 20 08:19:32 PDT 2005


If all you want to do is add variable text and you have the full version
of acrobat (the one that lets you create new documents), there is an
easier way to create PDFs.  Use acrobat to make the form look how you
want it and then in place of where the text should go, (ie, an employees
name) put something like #NAME#.

This is unlikely to appear naturally in the PDF file and allows you to
use the PDF as a template:

  $pdf_tmpl =~ s/#([A-Z]+)#/$my_values{$1}/ge;

I've done this with PDFs and a few other binary formats that store the
text data as plain text and it works great.

Of course this assumes you want to use PDFs...

Garth

On Wed, 2005-07-20 at 00:37 -0700, Joshua Wait wrote:
> Strange you should mention PDF. I just spent the
> better part of my day banging my head against creating
> PDFs in Perl.
> 
> Definitely go for PDF::API2. Some of the other modules
> work okay, but don't provide the same feature set. The
> documentation is absolutely horrible though.
> 
> I highly recommend this tutorial
> 
> http://www.printaform.com.au/clients/pdfapi2/
> 
> It made it work for me.
> 
> --JOSHUA
> 
> --- Herb Rubin <herbr at pfinders.com> wrote:
> 
> > I use enscript and create my own templates. Enscript
> > comes with Linux.
> > 
> > I can draw lines and insert eps (encapsulated
> > postscript) images.
> > (gif2eps works well).
> > 
> > Herb
> > 
> > 
> > On Tue, 2005-07-19 at 13:56, Jeffrey McDonald wrote:
> > > I work at Genentech and support a large number of
> > Perl applications
> > > that provide employees with Stock Purchase and
> > Stock Option
> > > information.
> > > 
> > > I am being asked to develop “Printer Friendly�
> > versions of these
> > > pages.
> > > 
> > >  
> > > 
> > > The only solution I can think of is to generate
> > PDF’s that tightly
> > > control the layout of the document.
> > > 
> > >  
> > > 
> > > On CPAN I am able to find many modules – just
> > don’t know which ones
> > > might be best.
> > > 
> > > I was wondering if anyone has
> > recommendations/experience with any of
> > > them.
> > > 
> > >  
> > > 
> > > One module I saw was able to take an HTML document
> > and turn it into a
> > > PDF – would really like to see how that might
> > work.
> > > 
> > > I was thinking that I would have to generate the
> > document line by line
> > > just as I do the HTML.
> > > 
> > >  
> > > 
> > > Thanks
> > > 
> > > Jeff
> > > 
> > >  
> > > 
> > >  
> > > 
> > >  
> > > 
> > > 
> > > 
> > >
> >
> ______________________________________________________________________
> > > _______________________________________________
> > > SanFrancisco-pm mailing list
> > > SanFrancisco-pm at pm.org
> > >
> > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
> > -- 
> > Herb Rubin                 Pathfinders Software
> > herbr at pfinders.com         http://www.pfinders.com
> > phone: 650-343-4571        fax:   650-343-4675
> > 
> > 
> > _______________________________________________
> > SanFrancisco-pm mailing list
> > SanFrancisco-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
> > 
> 
> 
> 
> 		
> ____________________________________________________
> Start your day with Yahoo! - make it your home page 
> http://www.yahoo.com/r/hs 
> 
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm



More information about the SanFrancisco-pm mailing list