> 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/web/page-manipulation/manipulation.md).

# PDF Manipulation with JavaScript Library

Enhance PDF files with WebViewer's JavaScript library for seamless page manipulations. Rotate, crop, reorder, add, or delete pages effortlessly. Optimize your PDF viewing experience on web. The Apryse

{% hint style="info" %}
**Requirements**

*These packages are required to use these features in production. Trial keys have unlimited access to all features*

<a href="https://apryse.com/capabilities#PageManipulation" class="button primary">Package: Page Manipulation</a><a href="https://showcase.apryse.com/pdf-page-manipulation-api" class="button primary">Live demo</a>
{% endhint %}

When WebViewer's JavaScript PDF library is running in [client only mode](/web/what-is-webviewer/deployment-options.md#client-only) it is able to perform many different kinds of page manipulations. These include rotating, cropping, reordering, adding, and deleting pages. Instead of temporarily modifying the document in the viewer, these operations modify the actual PDF data.

{% embed url="<https://www.youtube.com/embed/ZKt38W7Ro4Y>" %}

Here is the [full source-code](https://github.com/ApryseSDK/webviewer-document-merge/) to the application referred to in the video.

This means that when the download button is pressed or [getFileData](https://sdk.apryse.com/api/web/Core.Document.html#getFileData__anchor) is called, the returned PDF will have the manipulations applied and they will be visible in any PDF viewer.

{% hint style="warning" %}
If you're using the WebViewer Server deployment option then you'll need to enable the `forceClientSideInit: true` constructor option. This will initialize the document with WebViewer Server and then switch to client side processing. Page manipulation only works with PDF documents. When working with Office documents, enable the `loadAsPDF: true` constructor option to automatically convert office files to PDF format before performing page manipulations.
{% endhint %}

Page manipulation is the ability to perform changes to pages.

Apryse SDK benefits include:

* Split pages
* Merge and append pages
* Split and combine PDF pages
* Replicate and reorder pages
* Assemble new documents from a mixture of dynamic and static documents
* Remove existing pages
* Crop and rotate pages
* Adjust page dimensions (e.g. adjust media/crop/bleed box)
* Reposition page content
* Work with PDF page labels (read or edit existing labels and create new labels)
* Edit text directly on PDF files (experimental feature).

## Get started

[Insert pages](/web/page-manipulation/insert.md) To insert pages into a PDF document.

[Remove pages](/web/page-manipulation/remove.md) To remove pages from a PDF document.

[Rotate a page](/web/page-manipulation/rotate.md) To rotate a page in a PDF document.

[Crop a page](/web/page-manipulation/crop.md) To crop a page in a PDF document.

[Reorder pages](/web/page-manipulation/reorder.md) To reorder pages in a PDF document.

[Split PDF pages](/web/page-manipulation/split.md) To split a PDF document into multiple pages.

[Merge multiple PDF files](/web/page-manipulation/merge.md) To merge multiple PDF files into one document.

## Tools & Utilities

[PDF PageMaster](/cli/pdf-pagemaster/pdf-pagemaster.md) A command-line tool that can be used for splitting, merging, editing, and securing PDF documents.


---

# 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/web/page-manipulation/manipulation.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.
