Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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 ( ) 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");?


Enough codes make shapes. (Hamidjon)

In reply to Documentation of PDF::GetImages is lack of some info concerning the 'optionals' by programmer.perl

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [LanX]: according to wp: Londoners voted in a referendum in 1998 to create new governance structures for Greater London.
    [LanX]: so it was the will of the people to take back control
    [LanX]: ;)

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (11)
    As of 2017-12-15 19:06 GMT
    Find Nodes?
      Voting Booth?
      What programming language do you hate the most?

      Results (442 votes). Check out past polls.