I'm using PDF::Parse [search.cpan.org] for the first time and it's just not working. I just downloaded it and installed it today (Linux 2.6, Apache 1.3, Perl 5.8.0). I've simplified my CGI script to just the specific code that fails, and I'm now running it as a shell script for troubleshooting:
#!/usr/bin/perl
use PDF::Parse;$file = '/tmp/test.pdf';
$size = (-s $file);
print "The size of $file is $size bytes.\n";
$pdf->TargetFile($file);
exit(0);
The error message is "Can't call method "TargetFile" on an undefined value". I know that the $file value is defined properly because the size prints properly. I've even tried hard-coding the file path, same error though. If I turn on warnings (via "-w"), I get the following errors:
PDF::Core::PDFGetPrimitive() called too early to check prototype at /usr/lib/perl5/site_perl/5.8.0/PDF/Core.pm line 288.
PDF::Core::PDFGetPrimitive() called too early to check prototype at /usr/lib/perl5/site_perl/5.8.0/PDF/Core.pm line 294.
Name "main::pdfinfo" used only once: possible typo at ./test.pl line 9.
So apparently there's some problem with the module. The documentation at CPAN provides a web link at geocities for reference, but that page no longer exists (surprise). A Google search didn't yield much. Has anyone used this module? Or is there a more reliable module to use for parsing PDF files?
What you can do is try to fix the current module and make it work. Write to the creators and ask their help. If you fix the module, make sure you submit your changes back to CPAN.
PDF::Core works in conjunction with PDF::Parse. It's by the same authors. Neither of the modules is fully functionaly by itself.
ahh, I didn't take the time to look. I assumed PDF::Parse was more like a user friendly interface to PDF::Core. Thanks for the correction.
Maybe try another module by the same author and see if it does work, requires the other two modules though so probably not, but nothing to lose by trying.
[search.cpan.org...]