> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
