A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu


Page Selection

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


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

expression page selection
even include even pages
odd include 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.


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

-pages -3,5,7-

Select pages 4 to 7 but exclude page 6:

-pages "4-7,!6"

Select all pages other than page 5:

-pages "1-,!5" 

Select all odd pages other than page 1:

-pages odd,n1