Creating PDF documents from a Perl Program...

Creating PDF documents from a Perl Program...

am 15.04.2008 13:11:02 von Danish

Hi there,

I'm working on a database driven website and I need to output data in
PDF format. The database handling is all written in Perl so I'd prefer
to stick to Perl if possible, hence my question in this newsgroup!

I've done some research and come up with a couple of ideas: PDF on the
Fly from Nottingham University and a module listed on CPAN called PDF-
Create-0.08 by Markus Baertschi.

What I'd like to know is if anyone out there has experience of doing
this kind of thing. What method they used and what problems they hit,
if any.

Thanks in advance,

Nigel

Re: Creating PDF documents from a Perl Program...

am 15.04.2008 15:43:55 von mstep

Hi Nigel,


I am far of being able to give advices in this group of Perl-Gurus.
But my first idea would be, to insert your data in a LaTeX-template
and run over it the pdflatex command. The output is really
beautiful ...


greetings from Munich



marek

Re: Creating PDF documents from a Perl Program...

am 15.04.2008 15:54:31 von Gunnar Hjalmarsson

Danish wrote:
> I'm working on a database driven website and I need to output data in
> PDF format.



> I've done some research and come up with a couple of ideas: PDF on the
> Fly from Nottingham University and a module listed on CPAN called PDF-
> Create-0.08 by Markus Baertschi.

So.. What's preventing you from trying out one of them?

> What I'd like to know is if anyone out there has experience of doing
> this kind of thing.

Of course. That's why there are modules available.

> What method they used

Using a module, perhaps?

> and what problems they hit, if any.

To start with, you'd better assume that possible problems have been
taken care of by the module authors.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Re: Creating PDF documents from a Perl Program...

am 16.04.2008 06:05:09 von Gerry Ford

"Danish" wrote in message
news:11fc2e51-1881-431b-97dc-8bf25c5c522f@m71g2000hse.google groups.com...
> Hi there,
>
> I'm working on a database driven website and I need to output data in
> PDF format. The database handling is all written in Perl so I'd prefer
> to stick to Perl if possible, hence my question in this newsgroup!
>
> I've done some research and come up with a couple of ideas: PDF on the
> Fly from Nottingham University and a module listed on CPAN called PDF-
> Create-0.08 by Markus Baertschi.
>
> What I'd like to know is if anyone out there has experience of doing
> this kind of thing. What method they used and what problems they hit,
> if any.

Nigel,

I thought I might try the same task. My ppm shows 2 different .08 versions
available, one by Markus and another by Fabian.

I can't tell 100% which one I did, but right off the bat I tried to fire up
their sample.pdf in \lib\PDF\ and acrobat can't read it. I think this bodes
poorly for the process that created it.

I wish I could tell you which one I had. With ppm, I feel like a toddler
with a fire hose.:-0
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."

~~ Booman

Re: Creating PDF documents from a Perl Program...

am 16.04.2008 16:56:57 von Danish

On Apr 16, 6:05=A0am, "Gerry Ford" wrote:
> "Danish" wrote in message
>
> news:11fc2e51-1881-431b-97dc-8bf25c5c522f@m71g2000hse.google groups.com...
>
> > Hi there,
>
> > I'm working on a database driven website and I need to output data in
> > PDF format. The database handling is all written in Perl so I'd prefer
> > to stick to Perl if possible, hence my question in this newsgroup!
>
> > I've done some research and come up with a couple of ideas: PDF on the
> > Fly from Nottingham University and a module listed on CPAN called PDF-
> > Create-0.08 by Markus Baertschi.
>
> > What I'd like to know is if anyone out there has experience of doing
> > this kind of thing. What method they used and what problems they hit,
> > if any.
>
> Nigel,
>
> I thought I might try the same task. =A0My ppm shows 2 different .08 versi=
ons
> available, one by Markus and another by Fabian.
>
> I can't tell 100% which one I did, but right off the bat I tried to fire u=
p
> their sample.pdf in \lib\PDF\ and acrobat can't read it. =A0I think this b=
odes
> poorly for the process that created it.
>
> I wish I could tell you which one I had. =A0With ppm, I feel like a toddle=
r
> with a fire hose.:-0
> --
> "Shopping for toilets isn't the most fascinating way to spend a Saturday
> afternoon. But it beats watching cable news."
>
> ~~ =A0Booman

Hi Booman,

I installed the PDF::Create module and tried the sample.pl program -
same result as you: couldn't open the sample.pdf created. I
investigated further and found that the sample program tries to
include a .gif and a .jpg which weren't automatically downloaded with
the install. I retrieved them from CPAN, placed them in the same
directory as the sample program and it worked. All this on my PC
running under XP, I've yet to try installing and running it on my UNIX
server, but if it goes this easily I'll be very happy.

Oh, and it seems the module was worked on by both Fabien AND Markus.

Cheers,

Nigel

Re: Creating PDF documents from a Perl Program...

am 18.04.2008 05:12:12 von Gerry Ford

"Danish" wrote in message
news:c645df27-e3ee-4a2b-a0d0-395f457ef6e2@y21g2000hsf.google groups.com...
On Apr 16, 6:05 am, "Gerry Ford" wrote:

> I can't tell 100% which one I did, but right off the bat I tried to fire
> up
> their sample.pdf in \lib\PDF\ and acrobat can't read it. I think this
> bodes
> poorly for the process that created it.
>
> I wish I could tell you which one I had. With ppm, I feel like a toddler
> with a fire hose.:-0
> --
> "Shopping for toilets isn't the most fascinating way to spend a Saturday
> afternoon. But it beats watching cable news."
>
> ~~ Booman

Hi Booman,

I installed the PDF::Create module and tried the sample.pl program -
same result as you: couldn't open the sample.pdf created. I
investigated further and found that the sample program tries to
include a .gif and a .jpg which weren't automatically downloaded with
the install. I retrieved them from CPAN, placed them in the same
directory as the sample program and it worked. All this on my PC
running under XP, I've yet to try installing and running it on my UNIX
server, but if it goes this easily I'll be very happy.

Oh, and it seems the module was worked on by both Fabien AND Markus.

Cheers,

Nigel
--->My point was slightly different. I would think that the sample.pdf
would be an example of something that could stand by itself and be read by
acrobat. Why else the filetype?

Do I take it that you got the script to work and that you have something
that acrobat reads?

Maybe the sample.pdf needs the script to run correctly before it can be
read.
--
"A belief in a supernatural source of evil is not necessary; men alone
are quite capable of every wickedness."

~~ Joseph Conrad (1857-1924), novelist

Re: Creating PDF documents from a Perl Program...

am 21.04.2008 18:42:42 von hjp-usenet2

On 2008-04-15 11:11, Danish wrote:
> I'm working on a database driven website and I need to output data in
> PDF format. The database handling is all written in Perl so I'd prefer
> to stick to Perl if possible, hence my question in this newsgroup!
>
> I've done some research and come up with a couple of ideas: PDF on the
> Fly from Nottingham University and a module listed on CPAN called PDF-
> Create-0.08 by Markus Baertschi.

I've used PDF::Create in the past (the PDF files below
http://www.wifo.ac.at/wwa/jsp/index.jsp?&fid=26950 are created with it).
It's relatively simple to use but quite limited (I had to add a method
to draw rectangles to get the striped look).

For new projects I'd use PDF::API2. It is very powerful, but a bit more
complicated to use (and last time I looked the docs weren't very good),
but there is a mailinglist where you can get help. The author is using
it to create colourful reports for the management from various databases
(mostly networking statistics, afaik), so it's probably not far off what
you need. (Generally it's rather low level - there was talk about adding
some higher-level functions, but I don't know if it was done).

hp