programmer.perl has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I'm working with the PDF::GetImages. This module extracts the image(s) that are in PDF Afiles and puts them to current dir. But, I need that the module extracts the images to the path where I want.
I couldn't find the place where I should put the variable $processing_path.
In docs of module (http://search.cpan.org/~leocharre/PDF-GetImages-1.18/lib/PDF/GetImages.pod#pdfimages%28%29
) written such: "Optional argument, is path to a dir to which to send images extracted.", but I couldn't find where to put this optional argument... there is no such example...
Also the search in perlmonks didn't give results...
I can't find the place where I should put the variable $processing_path.
My code:
#!/usr/bin/perl -w use 5.010; use strict; use warnings; use Cwd qw(); use PDF::GetImages 'pdfimages'; my $path = Cwd::cwd(); my $processing_path = $path.'/newfolder/'; my $images = pdfimages($path.'/file.pdf') or die($PDF::GetImages::errs +tr); scalar @$images or die("no images in $path"); for (@$images){print "$_\n";}
It will be a good if you point where of line 9 to put the $processing_path variable.
And, what is the function of this line scalar @$images or die("no images in $path");?
Thanks,
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Documentation of PDF::GetImages is lack of some info concerning the 'optionals'
by jms53 (Monk) on Feb 09, 2013 at 11:56 UTC | |
by programmer.perl (Beadle) on Feb 09, 2013 at 12:08 UTC | |
by jms53 (Monk) on Feb 09, 2013 at 12:41 UTC | |
by programmer.perl (Beadle) on Feb 09, 2013 at 13:51 UTC | |
by programmer.perl (Beadle) on Feb 09, 2013 at 13:03 UTC |