Skip to content
Guides

Insert Pages

Insert a blank page or pages from other PDFs into the target document.

Insert Blank Pages

This example shows how to insert a blank page:

javascript
// Insert after the first page.
const pageIndex = 1;
const width = 612;
const height = 792;

docViewer.insertBlankPage(pageIndex, width, height)

Insert Pages from other PDFs

This example shows how to insert pages from other PDFs:

javascript
const file = {...} // File Object.
const pageIndexToInsert = 1
const pagesToInsert = [1, '3-5'] // Insert the range of PDF pages.

docViewer.insertPages(file, pageIndexToInsert, pagesToInsert)