NPM Package/docs/components/pdf/page-replace
Page Replace
Replace pages in the current PDF with pages from another PDF using page-replace with the SDK.
The page-replace action swaps pages in the current PDF with pages from another PDF file. Like insert, the parent provides a File object and the source pages to import.
This action is used when the target pages in the current document should be replaced, not just supplemented.
- Required fields:
pageRange,file, andselectedPages. - Use
pageRangeto identify the page or pages being replaced in the current file. - Use
selectedPagesto identify the source pages being inserted in their place.
Replace page index 4 in the current PDF with page index 0 from a source PDF.
typescript
Example
Example showing how to replace pages programmatically:
typescript
Vanilla TS Integration
Open the focused demo to test page replacement from another PDF file.
PDF Page Replace Demo
Focused live demo for page-replace.
Preview opens in a large modal for zoom-friendly review.
