Section:
Overview
Get Started
Without Viewer
FAQ
Opening Documents
Load/View Tiff
Saving Annotations
Measurement
Signature
Document Search
Redaction
Coordinates
Stamp content
Watermark
Remove images
Reading content
Write content
Replace page content
Graphics state
Edit Text
Replace Text
Convert Documents
Import/Export
Create form fields
Remove form fields
Modify form fields
Fill form fiellds
Style form fields
Form flatten
Date picker
Embedded JavaScript
APIs
WebViewer Events
Annotation Events
Text Select Events
Insert pages
Remove pages
Rotate pages
Crop pages
Reorder pages
Extract pages
Merge files
Thumbnail controls
Pages in the PDF document can be reordered using the movePages function.
1// config.js2const { documentViewer } = instance.Core;34documentViewer.addEventListener('documentLoaded', async () => {5 const doc = documentViewer.getDocument();6 const page1 = 1, page2 = 2, page3 = 3;78 const pagesToMove = [page2, page3];9 const insertBefore = page1;1011 await doc.movePages(pagesToMove, insertBefore);12 // pages are now in the order of [page2, page3, page1];13});
1// config.js2const { docViewer } = instance;34docViewer.on('documentLoaded', async () => {5 const doc = docViewer.getDocument();6 const page1 = 1, page2 = 2, page3 = 3;78 const pagesToMove = [page2, page3];9 const insertBefore = page1;1011 await doc.movePages(pagesToMove, insertBefore);12 // pages are now in the order of [page2, page3, page1];13});
Did you find this helpful?
Trial setup questions?
Need other help?
Pricing or product questions?