Extract PDF Pages on Linux
September 3, 2009 | In Other Tech | No CommentsYou 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
Powered by WordPress
RSS Feed - Syndicate this Site
and comments feed



