/docs/components/pdf/page-replace
Page Replace
Replace pages in the current PDF with pages from another PDF using page-replace.
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`, and `selectedPages`.
- Use `pageRange` to identify the page or pages being replaced in the current file.
- Use `selectedPages` to identify the source pages being inserted in their place.
Replace page 4 in the current PDF with page 0 from a source PDF.
Example
Use this full standalone HTML document when you want a minimal host page for replacing pages from another PDF.
html
Complete HTML Example
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.
