On Mon Mar 27 18:17:50 2017, abrahmia@physics.rutgers.edu wrote:
Show quoted text> Any reasons why this simple script does not run within a Perl Tk program.
>
> use CAM::PDF;
>
> my $pdf = CAM::PDF->new("file.pdf") ; <--THE PROBLEM IS HERE
>
> my $pages = $pdf->numPages(); #number of pages in the document
>
>
> HERE IS THE ERROR MESSAGE:
> Tk::Error: Can't call method "numPages" on an undefined value at ...
Whether it is running inside a Tk environment should make no difference. It is a matter of whether CAM::PDF is able to read the PDF in question. Is it possible to attach the PDF that fails?
(Please note: I am not involved in maintaining CAM::PDF. I am just a lurker who uses it occasionally.)