> 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/insert.md).

# Inserting pages into a PDF from command-line

Merge pages from multiple input documents into a new output file with the pagemaster tool. Learn how to insert, append, or prepend files with specified page ranges. Try it now! The Apryse CLI streamli

Pages from multiple input documents can be sequentially inserted (or appended) into a new output document. Users can optionally specify a range of pages to use from each input document.

**Syntax:**

`pagemaster (-i or \--insert) \<file to insert\> \<input files\>`

By default, the inserted file is appended to the input files, but otherwise the following options can be used:

\--before \<page number>

causes the inserted file to be inserted before page \<page number>

\--after \<page number>

causes the inserted file to be inserted after page \<page number>

## **Examples**

Insert toinsert.pdf before page 4 in inserted.pdf:

`pagemaster -i toinsert.pdf --before 4 inserted.pdf`

Append toinsert.pdf to append.pdf:

`pagemaster -i toinsert.pdf append.pdf`

Prepend toinsert.pdf to prepend.pdf:

`pagemaster -i toinsert.pdf --before 1 prepend.pdf`


---

# 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/insert.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.
