Rasterex APINPM Package/docs/components/pdf/page-insert-blank

Page Insert Blank

Insert blank pages into the current PDF with page-insert-blank using the SDK.

Overview

The page-insert-blank action creates new blank pages inside the current PDF. The host does not provide another file for this workflow.

Instead, the host tells the canvas where to insert the blank pages, how many to create, and what size they should be.

  • Required fields: pageRange, count, width, and height.
  • Use document pixel units for width and height.
  • This action is useful when operators need spacer pages, title sheets, or placeholders.

Example

Insert two blank pages at the selected location in the current PDF.

typescript
await viewer.documents.manipulatePages({
  action: "page-insert-blank",
  pageRange: [[3]],
  count: 2,
  width: 816,
  height: 1056
});
Example

Vanilla TS Integration

Example showing how to insert blank pages programmatically:

typescript
import { createViewer } from "@rasterex/viewer";

const viewer = createViewer({
  container: "#viewer"
});

await viewer.mount();
await viewer.ready();

async function addBlankPages(targetIndex: number, count: number): Promise<void> {
  try {
    await viewer.documents.manipulatePages({
      action: "page-insert-blank",
      pageRange: [[targetIndex]],
      count,
      width: 816,
      height: 1056
    });
    console.log("Blank pages inserted successfully");
  } catch (error) {
    console.error("Blank insertion failed:", error);
  }
}
Vanilla TS Integration

Live Preview

Open the focused demo to test blank-page insertion live.

PDF Page Insert Blank Demo

Focused live demo for page-insert-blank.

Preview opens in a large modal for zoom-friendly review.