From: J�rgen Exner on
HerbF(a)earthlink.net wrote:
>J�rgen Exner wrote:
>
>>HerbF(a)earthlink.net wrote:
>>>I have a Perl script that generates an HTML page and sends it to a
>>>recipient via email. I would prefer to send the recipient a pdf document
>>>instead of the HTML page. Is there "an easy" method of doing this within
>>>the Perl script?
>>
>>I suppose you checked http://search.cpan.org/search?query=PDF&mode=all
>>already?
>>
>Yes, thank you I have. As a Perl neophyte, I was prompted to ask because
>of the existence of multiple modules and my confusion at which one to
>select.

So your question wasn't so much "is there an easy method" but rather
"which of the modules do you recommend". Different question, different
answer.

Well, from the documentation it looks like PDF::Create is easy to use
for simple documents. If you want to create more complex documents then
I would assume you will need an understanding of how PDF works.

jue
From: HerbF on
J�rgen Exner wrote:

>HerbF(a)earthlink.net wrote:
>>J�rgen Exner wrote:
>>
>>>HerbF(a)earthlink.net wrote:
>>>>I have a Perl script that generates an HTML page and sends it to a
>>>>recipient via email. I would prefer to send the recipient a pdf document
>>>>instead of the HTML page. Is there "an easy" method of doing this within
>>>>the Perl script?
>>>
>>>I suppose you checked http://search.cpan.org/search?query=PDF&mode=all
>>>already?
>>>
>>Yes, thank you I have. As a Perl neophyte, I was prompted to ask because
>>of the existence of multiple modules and my confusion at which one to
>>select.
>
>So your question wasn't so much "is there an easy method" but rather
>"which of the modules do you recommend". Different question, different
>answer.
>
>Well, from the documentation it looks like PDF::Create is easy to use
>for simple documents. If you want to create more complex documents then
>I would assume you will need an understanding of how PDF works.
>
Thanks.

H-
From: John Bokma on
HerbF(a)earthlink.net writes:

> John Bokma wrote:
>
>>HerbF(a)earthlink.net writes:
>>
>>> I have a Perl script that generates an HTML page and sends it to a
>>> recipient via email. I would prefer to send the recipient a pdf document
>>> instead of the HTML page. Is there "an easy" method of doing this within
>>> the Perl script?
>>
>>Check out the "Converting HTML to PDF with Webkit" thread of last week,
>>especially the answers by Dr.Ruud ;-)
>
> Thanks, John, I did. It appears that webkit is an external program that
> reads a screen and converts it to pdf. I need to do this within Perl, on
> my remote (CGI) server.

Clear. I have only limited experience with PDF::API2::Lite [1] which is
most likely too low-level for this. Unless you want to parse the HTML
and render it to HTML yourself (which depending on the complexity might
not be as bad as it sounds).

[1] http://johnbokma.com/mexit/2009/02/24/jpeg-to-pdf-using-perl.html

--
John Bokma j3b

Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development
From: ccc31807 on
On Jun 12, 12:27 pm, He...(a)earthlink.net wrote:
> I have a Perl script that generates an HTML page and sends it to a
> recipient via email. I would prefer to send the recipient a pdf document
> instead of the HTML page. Is there "an easy" method of doing this within
> the Perl script?

I create great numbers of PDF documents for various purposes. Some are
reports, but some are collections of PDF documents that we send to
directors/managers to print and distribute (as hard copies) to the
people that they direct/manage.

I use PDF::API2, and can report that it performs reliably and has
never failed.

On the downside, I haven't found very good documentation, and I'm sure
that my code has a lot of cruft that results from sheer ignorance.

I find that it's very similar to generating HTML using absolute
positioning. Once you get over the grunt work of creating the
template, you can generate as many documents as you need to.

If all you need is an 'easy' method to send one document, then
PDF::API2 probably will be too much work for the benefit you will
derive. However, if you need to generate many PDF files, it may be
exactly what you need.

If you need some code, contact me privately at ccc31807 at yahoo dot
com and I'll send you one of my scripts.

CC.
From: bobmct on
Herb;

What platform is your cgi running on?

In my case I often product complex reports from perl. So I write them
to a text file then use a free winblows utility text2pdf that does a
GREAT job virtually instantaneously. If you can write your html code
to a file on Windoze then this utility would work for you.

Good luck