Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] PDF page count

Expand Messages
  • Hernán Gonzalo Asorey
    Hi! i had the same problem and I solve that by using pdftops. May be there is a simpler and elegant way, but it works fine: $pages = `pdftops $homedir/$file -
    Message 1 of 4 , Sep 29, 2007
    • 0 Attachment
      Hi! i had the same problem and I solve that by using pdftops. May be there
      is a simpler and elegant way, but it works fine:

      $pages = `pdftops $homedir/$file - 2>> pages.err | grep -c "%%Page:"`;
      chomp($pages);
      $pages *= 1.;
      print "$pages\n";
      Cheers!

      Hernán

      On 9/29/07, selva kumar <templateteam@...> wrote:
      >
      > Hello All,
      >
      > I want to count the total number of PDF pages in the files. I have tried
      > thru PDF modules Parse, API2, Extract. but it fails to read all PDF files.
      >
      > Can anybody please let me know which module i can use to count the total
      > number of pages.
      >
      > Thanks in Advance
      > Anil
      >
      > ---------------------------------
      > Looking for a deal? Find great prices on flights and hotels with Yahoo!
      > FareChase.
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >



      --
      ---------------------------------------------
      Mg. Hernán Gonzalo Asorey
      Instituto Balseiro - CAB
      (8400) San Carlos de Bariloche
      Río Negro - Rep. Argentina
      ---------------------------------------------
      cabtep5.cnea.gov.ar/~asoreyh/


      [Non-text portions of this message have been removed]
    • selva kumar
      Hi Hernán, I am using PC version. I think this is UniX command. Is there any other way to do this in PC version. Regards Anil Hi! i had the same problem and I
      Message 2 of 4 , Oct 3, 2007
      • 0 Attachment
        Hi Hernán,

        I am using PC version. I think this is UniX command. Is there any other way to do this in PC version.

        Regards
        Anil



        Hi! i had the same problem and I solve that by using pdftops. May be there
        is a simpler and elegant way, but it works fine:

        $pages = `pdftops $homedir/$file - 2>> pages.err | grep -c "%%Page:"`;
        chomp($pages) ;
        $pages *= 1.;
        print "$pages\n";
        Cheers!

        Hernán

        On 9/29/07, selva kumar <templateteam@ yahoo.com> wrote:
        >
        > Hello All,
        >
        > I want to count the total number of PDF pages in the files. I have tried
        > thru PDF modules Parse, API2, Extract. but it fails to read all PDF files.
        >
        > Can anybody please let me know which module i can use to count the total
        > number of pages.
        >
        > Thanks in
        Advance
        > Anil



        Moody friends. Drama queens. Your life? Nope! - their life, your story.
        Play Sims Stories at Yahoo! Games.





        ____________________________________________________________________________________
        Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7


        [Non-text portions of this message have been removed]
      • a_z0_9_blah
        ... other way to do this in PC version. ... Hi Anil You will need to go to http://www.foolabs.com/xpdf/ to download xpdf, (look for the Windows version in the
        Message 3 of 4 , Oct 4, 2007
        • 0 Attachment
          --- In perl-beginner@yahoogroups.com, selva kumar <templateteam@...>
          wrote:
          >
          > Hi Hernán,
          >
          > I am using PC version. I think this is UniX command. Is there any
          other way to do this in PC version.
          >
          > Regards
          > Anil


          Hi Anil

          You will need to go to http://www.foolabs.com/xpdf/ to download
          xpdf, (look for the Windows version in the downloads section). You
          are correct in saying his is a Unix solution. You'll need to read
          the documention to see how to call it from Windows.

          Below is a link to: How to pull Text from a PDF using Perl?
          (from perl beginners) David Wagner gave an example using Windows.
          However, I believe you'll want to use the pdftops command as Hernán
          has said, just without some of the Unix syntax at the end somehow.

          (the link below is all 1 line so you'll have to 'reconstruct' it
          into 1 line in a text editor then paste it into your browser's
          address bar)

          http://groups.google.com/group/perl.beginners/browse_frm/thread/33e83
          52da6aaaa4/f507e3ce60ede578?
          hl=en&lnk=gst&q=How+to+pull+Text+from+a+PDF+using+Perl&rnum=1#f507e3c
          e60ede578


          Hope this helps,

          Chris




          >
          >
          > Hi! i had the same problem and I solve that by using pdftops. May
          be there
          > is a simpler and elegant way, but it works fine:
          >
          > $pages = `pdftops $homedir/$file - 2>> pages.err | grep -c "%%
          Page:"`;
          > chomp($pages) ;
          > $pages *= 1.;
          > print "$pages\n";
          > Cheers!
          >
          > Hernán
          >
          > On 9/29/07, selva kumar <templateteam@ yahoo.com> wrote:
          > >
          > > Hello All,
          > >
          > > I want to count the total number of PDF pages in the files. I
          have tried
          > > thru PDF modules Parse, API2, Extract. but it fails to read all
          PDF files.
          > >
          > > Can anybody please let me know which module i can use to count
          the total
          > > number of pages.
          > >
          > > Thanks in
          > Advance
          > > Anil
        Your message has been successfully submitted and would be delivered to recipients shortly.