Extract PDF Pages on Linux

You downloaded a PDF file and you are only interested in particular pages say 23-56 and the rest of it  is useless for you, then you can use the GhostScript utility to extract  these range of pages as a new PDF so you can save on size, and gain on reading confidence ( I hate books with huge no. of pages .. ) .

You can do this via this command line:

$ gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=22 -dLastPage=36 \
-sOutputFile=outfile_p22-p36.pdf 100p-inputfile.pdf

Remember to change the following params here

100p-inputfile.pdf             Change it to your own input PDF file

-dFirstPage=22                 Change it with your starting page range

-dLastPage=36                  Change it to your range’s  last page

-sOutputFile=pages22-36.pdf    Change it to any arbitrary filename of your own

$  gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=228 -dLastPage=329 \
-sOutputFile=outfile_ZF_Zend_DB.pdf ZendFramework1.6.pdf

// With actual PDF Page #’s
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=267 -dLastPage=366 \
-sOutputFile=outfile_ZF_Zend_DB.pdf ZendFramework1.6.pdf

This is the easiest and the fastest method to achieve a page range extract as it uses the native GhostScript utility which is available in every distro of Unix/Linux Nowdays , so you can use it without installing any package or utility .

source: http://www.techstroke.com/extract-selected-range-of-pages-of-a-pdf-as-a-pdf-file-in-linux.html

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress RSS XMLRSS Feed - Syndicate this Site and comments feed
linux GNUpowered by Apache tomcatMySQL ABPHP - The Language the Web Runs on

^Top^ Gare CalhounGare CalhounGare CalhounGare CalhounGare Calhoun