> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/cli/pdf-pagemaster/usage/remove.md).

# Remove pages from PDF with command-line

Learn how to remove specific pages or page ranges from PDF documents using the -r or --remove option with pagemaster. Customize your merging process and manage output directories efficiently. Examples

To remove specific pages or page ranges from PDF documents, use -r or --remove option.

**Syntax:**

`pagemaster (-r or --remove) <input file1>,<pagelist1>,<pagelist2>`

The operation will remove the given pages (in each page-list) from the input files. For a detailed description of how to specify 'page-lists' as part of PDF merge operation, please refer to Section 4.8 of this user manual. The following are some additional examples of how to use 'page-lists' to customize the merging process:

By default, the files will be overwritten, but the -o option can be used to specify an output directory.

Please note that because PDF documents must contain at least one page, the 'remove' function cannot delete all pages in a document.

## Examples

Remove page 1 of firstpageremoved.pdf:

`pagemaster -r firstpageremoved.pdf,1`

Remove the first page from all PDF documents located in MyPDFs folder and its sub-folders:

`pagemaster -r MyPDFs,1 \--subfolders`

Similar to above line, but save all files in the 'Output' folder instead of overwriting the originals: pagemaster -r MyPDFs,1 --subfolders

Remove all odd pages from 'in1.pdf' and all even pages from 'in2.pdf':

`pagemaster -r in1.pdf,o in2.pdf,e`

Remove all even pages as well as the odd pages between 1 and 10 (1, 3, 5, 7, 9):

`pagemaster -r mixedpages.pdf,e,1-10`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/cli/pdf-pagemaster/usage/remove.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
