convert/export Perl output to a PDF for online viewing and retrieval

I have co-authored a Perl script which parses a log file (a content-filtering log of sites visited and banned) and now I would like to export the output to a PDF for easy user retrieval.  Is is possible to do directly from the Perl or how could I use a PHP function like ezPDF to take the outputted (HTML) page and convert it to PDF format?

Thanks in advance for any and all advice/tips/help

Brandon (phishee)
phisheeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kanduraCommented:
Although I haven't used them myself yet, I know that there are a number of Perl modules you can use. PDF::API2, PDF::Report, PDF::Reuse are some I've seen. PDF::Template looks promising, as it allows you to write a template in xml, and then fill it with data using perl.

For all available modules, have a look at http://search.cpan.org and search for pdf.

HTH,
Kandura
0
rj2Commented:
Here is link to module that can create PDF files.
http://search.cpan.org/~ftassin/PDF-Create-0.01/

But why do you want to make results from parsing log files into PDF, can't users just as easily retrieve a plain text file?
PDF files are usually used for documents with embedded graphics where preserving exact layout is important.
That is usually not the case for log files.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mattaustinCommented:
PDF::Create is the way to go! works great!

    use PDF::Create;

    my $pdf = new PDF::Create('filename' => 'mypdf.pdf',
                              'Version'  => 1.2,
                              'PageMode' => 'UseOutlines',
                              'Author'   => 'Fabien Tassin',
                              'Title'    => 'My title',
                         );
    my $root = $pdf->new_page('MediaBox'  => [ 0, 0, 612, 792 ]);

    # Add a page which inherits its attributes from $root
    my $page = $root->new_page;

    # Prepare 2 fonts
    my $f1 = $pdf->font('Subtype'  => 'Type1',
                            'Encoding' => 'WinAnsiEncoding',
                         'BaseFont' => 'Helvetica');
    my $f2 = $pdf->font('Subtype'  => 'Type1',
                         'Encoding' => 'WinAnsiEncoding',
                         'BaseFont' => 'Helvetica-Bold');

    # Prepare a Table of Content
    my $toc = $pdf->new_outline('Title' => 'Document',
                                'Destination' => $page);
    $toc->new_outline('Title' => 'Section 1');
    my $s2 = $toc->new_outline('Title' => 'Section 2', 'Status' => 'closed');
    $s2->new_outline('Title' => 'Subsection 1');

    $page->stringc($f2, 40, 306, 426, "PDF::Create");
    $page->stringc($f1, 20, 306, 396, "version $PDF::Create::VERSION");

    # Add another page
    my $page2 = $root->new_page;
    $page2->line(0, 0, 612, 792);
    $page2->line(0, 792, 612, 0);

    $toc->new_outline('Title' => 'Section 3');
    $pdf->new_outline('Title' => 'Summary');

    # Add something to the first page
    $page->stringc($f1, 20, 306, 300, 'by Fabien Tassin <fta@oleane.net>');

    # Add the missing PDF objects and a the footer then close the file
    $pdf->close;
0
jmcgOwnerCommented:
Nothing has happened on this question in more than 8 weeks. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by rj2.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.