Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: PDF GetInfo(

by svad (Pilgrim)
on Apr 27, 2002 at 06:12 UTC ( [id://162478] : note . print w/replies, xml ) Need Help??

in reply to PDF GetInfo(

When I used for my local needs, I reworked it a lot, because it is not only warnings and strict unsafe, but also it does not always parse things correctly.
I did not succeeded polishing it to 100% working state yet.

Another solution - if your machine have Acrobat (exchange) you can use Win32::OLE module. It is not enough to have Acrobat Reader installed in this case :(

use strict; use Win32::OLE; use Win32::OLE::Const; my $abat = Win32::OLE->new('AcroExch.App'); my $abdoc = Win32::OLE->new('AcroExch.AVDoc'); $abdoc->Open('d:\Documentation\perl\xtk.pdf','d:\Documentation\perl\xt +k.pdf'); my $pddoc = $abdoc->GetPDDoc; print "pp=".$pddoc->GetNumPages,"\n"; for (qw(Title Subject Author)) { print "$_:".$pddoc->GetInfo($_),"\n"; }
Acrobat SDK documentation have information about how automate it via OLE.

Warmest wishes,

Replies are listed 'Best First'.
Re: Re: PDF GetInfo(
by svad (Pilgrim) on Apr 27, 2002 at 06:14 UTC
    line use Win32::OLE::Const; remains from my piece of code, it is not needed here
Re: Re: PDF GetInfo(
by axelrose (Scribe) on Apr 27, 2002 at 16:22 UTC

    Thanks for your answer, Vadim!

    I owe the full Acrobat program but for speed and portability reasons would prefer a pure Perl solution.

    pdflib is not under GNU, the other CPAN modules are as far as I've found more suited for PDF creation. I'd love to see corrected therefore. Let's see what the author says.

    Best wishes,