Question: I want to merge some pdf files in one, the command i am using is:

```
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=/var/www/test/pdf_merge/Merged.pdf /var/www/test/pdf_merge/1.pdf /var/www/test/pdf_merge/2.pdf /var/www/test/pdf_merge/3.pdf 

```

Now i want to merge specific pages in pdf, it is possible to do this with this command?

Answer: 
I do not know if gs supports working on individual pages (I suspect not), however there are two alternatives that have very good support for manipulating individual pdf pages.

[Pdfjam](http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/firth/software/pdfjam) (from package texlive-pdfjam-bin-2010-4.20100720.svn17868.fc15.x86\_64 on my system) and [pdftk](http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/).
Use something like the following, where the result.pdf will have pages 1-4 from 1.pdf, the complete 2.pdf and then the 3rd page of 3.pdf:

```
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -sOutputFile=result.pdf -dFirstPage=1 -dLastPage=4 1.pdf 2.pdf -dFirstPage=3 -dLastPage=3 3.pdf

```