![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Get the number from the txt file | happyv | UNIX for Dummies Questions & Answers | 7 | 01-10-2008 03:51 AM |
| How to grep a number in a file to find them in another file | ahjiefreak | Shell Programming and Scripting | 7 | 12-12-2007 06:01 AM |
| how to search string and number in one file and check in the other file | knshree | Shell Programming and Scripting | 9 | 08-24-2007 04:29 AM |
| Number Swaping.... in file | muneebr | UNIX for Dummies Questions & Answers | 3 | 12-17-2005 07:18 AM |
| Split text file by pages | ranri | UNIX for Dummies Questions & Answers | 2 | 06-01-2001 02:43 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
Writing a script will not do it. Depending on the software that created the pdf and whether or not it is encrypted is way beyond shell, and probably something a casual C coder would want to try.
Your best bet is to find some software like pdf2txt. Then run it from the command line, and grep for ^L - ascii 12 - which is a page feed. There is probably something like pdf2txt in the open source area, ie., free. Try connecting to SourceForge.net: Welcome to SourceForge.net, use the search engine there, and find pdf conversion software. Someone else here may know of a free product that is good. I don't. |
|
|||||
|
You could also try the pdftk app pdftk - the pdf toolkit
To get the number of pages: pdftk file.pdf dump_data output | grep -i Num NumberOfPages: 1 |
|
|||||
|
if you are familiar with Perl, check the PDF CPAN module
something like: Code:
#!/usr/bin/perl # get_pages_in_pdf_file.pl use PDF; my $filename = shift; my $this_pdf = PDF->new; $this_pdf = PDF->new($filename); print "Has ", $this_pdf->Pages, " Pages \n"; |
![]() |
| Bookmarks |
| Tags |
| count, count pages, ksh, page count, pdf, script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|