# Extracting pages from Document

**URL:** https://pdfjs.community/t/extracting-pages-from-document/1378
**Category:** Technical Support
**Tags:** pdfjs-express
**Created:** [February 14, 2022, 10:23am UTC](https://pdfjs.community/t/extracting-pages-from-document/1378 "2022-02-14T10:23:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RasmusVibe](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@RasmusVibe](https://pdfjs.community/u/RasmusVibe)
#### Post date: [February 14, 2022, 10:23am UTC](https://pdfjs.community/t/extracting-pages-from-document/1378/1 "2022-02-14T10:23:48Z")

</div>

**Which product are you using?**  
PDF.js Express Viewer v. 8.2.1

Developer console log:  
|UI version|‘8.2.0’|  
|Core version|‘8.2.1’|  
|Build|‘MS8yMC8yMDIyfGYyZTU5NTU0YQ==’|  
|WebViewer Server|false|  
|Full API|false|

**Detailed description of issue**  
Trying to extract the selected pages from my Document through the Core.Document.extractPages function mentioned in the documentation, but the promise throws undefined no matter what I do.

**Expected behaviour**  
Expected to have the pages that I fill in the input extracted to continue working with them.

**Does your issue happen with every document, or just one?**  
All documents

**Link to document**  
Any document can be used - not any specific, its a general issue for all documents.

**Code snippet**

#1 try

```javascript
const {Core} = getInstance();      
const document = Core.documentViewer.getDocument();
const pages = await document.extractPages([1]);

```

#2 try

```javascript
const {Core} = getInstance();
const pages = await Core.document.extractPages([1]);

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)
#### Post date: [February 14, 2022, 10:23am UTC](https://pdfjs.community/t/extracting-pages-from-document/1378/3 "2022-02-14T10:23:53Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [What is PDF.js Express? - Web Viewer’s iframe](https://pdfjs.express/documentation/learn-more/inside-express-viewer.8#web-viewer's-iframe)
- [Page Manipulation](https://pdfjs.express/documentation/advanced/page-manipulation)
- [Basic searching - Searching a document one by one](https://pdfjs.express/documentation/search/basic-search.8#searching-a-document-one-by-one)

APIs:
- [UI - extractPagesWithAnnotations(pageNumbersToExtract)](https://pdfjs.express/api/UI.html#.extractPagesWithAnnotations__anchor)
- [Core.Document - extractPages(pageArray [, xfdfString])](https://pdfjs.express/api/Core.Document.html#extractPages__anchor)
- [Core.Tools.CropCreateTool](https://pdfjs.express/api/Core.Tools.CropCreateTool.html#__anchor)

Forums:
- [Storing staticfiles on a separate subdomain](https://pdfjs.community/t/storing-staticfiles-on-a-separate-subdomain/828/1)
- [How to show only one page at a time in viewer](https://pdfjs.community/t/how-to-show-only-one-page-at-a-time-in-viewer/940/6)
- [Getting error log on loading a particular pdf](https://pdfjs.community/t/getting-error-log-on-loading-a-particular-pdf/564/1)

---

<div class="post-metadata">

### Author: ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)
#### Post date: [February 16, 2022, 4:05pm UTC](https://pdfjs.community/t/extracting-pages-from-document/1378/4 "2022-02-16T16:05:06Z")

</div>

Hi there,

PDF.js Express does not support extracting pages or any document manipulation.

We share an API with our sister produce, PDFTron WebViewer, which is why some documentation that we don’t support exists (sometimes they slip through the cracks)

Sorry for the confusion,

Logan
