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.
The steps to replace pages are as follows:
This example shows how to replace pages:
// Remove the first page from the document.
docViewer.removePages([0]);
// Insert the first page of another document into the original document's first-page position to complete the replacement.
const file = {...}; // File Object.
const pageIndexToInsert = 0;
const pagesToInsert = 'all'; // Insert the range of PDF pages.
docViewer.insertPages(file, pageIndexToInsert, pagesToInsert);