PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Insert a blank page or pages from other PDFs into the target document.
This example shows how to insert a blank page:
// Insert after the first page.
const insertBeforeThisPage = 2;
const width = 612;
const height = 792;
await documentViewer.getDocument().insertBlankPages([insertBeforeThisPage], width, height);This example shows how to insert pages from other PDFs:
const file = {...}; // File Object.
const insertBeforeThisPage = 2; // Insert after the first page.
const pagesToInsert = [1, '3-5']; // Insert the range of PDF pages.
const sourceDocument = await instance.Core.createDocument(file);
await documentViewer.getDocument().insertPages(sourceDocument, pagesToInsert, insertBeforeThisPage);