This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/web/editor/add-page.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Add page to PDF file using JavaScript | Nutrient SDK

Using addPage adds a blank page before or after the specified page index using the provided configuration:

instance.applyOperations([
{
type: "addPage",
afterPageIndex: 1, // Add a new page after page 1.
backgroundColor: new NutrientViewer.Color({ r: 100, g: 200, b: 255 }), // Set the new page background color.
pageWidth: 750,
pageHeight: 1000,
rotateBy: 0 // No rotation.
// Insets are optional.
}
]);

Exporting a PDF

After this operation is complete, you can call instance#exportPDF to get an ArrayBuffer containing the data for the final PDF.

If you need to apply this operation and export the resulting document in one step, you can provide the same argument passed to instance#applyOperations to instance#exportPDFWithOperations instead, and it’ll resolve to an ArrayBuffer containing the final PDF.