#!/usr/bin/perl -w use 5.010; use strict; use warnings; use Cwd qw(); use PDF::GetImages 'pdfimages'; my $path = Cwd::cwd(); my $abs = $path.'/file.pdf'; # filepath to pdf file my $opt = $path.'/processing/'; # new dir for output my $images = pdfimages($abs, $opt) or die($PDF::GetImages::errstr); scalar @$images or die("no images in $path"); for (@$images){print "$_\n";}