Copy & Paste
Copy pages into the viewer clipboard and paste them into the active PDF.
Copy and paste work together as one viewer-local clipboard flow. The parent tells the viewer which pages to copy, then later tells it where to paste them.
The parent application never sends page bytes, base64, or a file object between these two actions. The clipboard exists only inside the same viewer iframe session.
- page-copy uses `pageRange`.
- page-paste uses `targetPageIndex`.
- Paste only works after a successful copy in the same viewer session.
- If `targetPageIndex` is missing, paste fails even if the action name is correct.
Think of this as a two-step workflow owned by the viewer.
1. Host sends page-copy
Copy the selected pages from the current PDF into the viewer internal clipboard.
2. Host sends page-paste
Paste those copied pages at the chosen destination index.
3. Host listens for pageManipulationResult
Use the returned result to show errors and confirm the clipboard or paste state.
This is the minimal host-side copy/paste flow.
Use this full standalone HTML document when you want a minimal host page for the copy and paste workflow.
Open the focused demo to copy a page and paste it into another position in the same viewer session.
PDF Copy & Paste Demo
Focused live demo for the viewer-local copy/paste workflow.
Preview opens in a large modal for zoom-friendly review.
