Page Selection

The -pages flag allows you to select specific pages for processing when using the following commands:

Syntax

The value of this flag is a string which is a comma separated list of expressions containing page numbers or page number ranges:

expressionpage selection
eveninclude even pages
oddinclude odd pages
#include page #
#-#include page range
!#exclude page #
!#-#exclude page range
#-include page # - last page
-#include first page - page #
!#-exclude page # - last page
!-#exclude first page - page #

You can use either ! or n for negating an expression.! needs to be escaped with single quotes on the command line.

Examples

Select the first three pages, page 5 and page 7 up to the end of the document:

  1. -pages -3,5,7-

Select pages 4 to 7 but exclude page 6:

  1. -pages "4-7,!6"

Select all pages other than page 5:

  1. -pages "1-,!5"

Select all odd pages other than page 1:

  1. -pages odd,n1