After merging scanned files, you may find that the pages are in the wrong order, or you may want to move pages from the end of a document to the beginning. You can reorder PDF pages by specifying page indices, without first converting the PDF into images.
This article uses Spire.PDF for .NET to demonstrate two approaches: arranging pages in a custom order and reversing the page order of an entire document. Both examples use the same method, PdfPageCollection.ReArrange(int[] orderArray) . The difference lies in how the ordering array is generated.
1. Install Spire.PDF for .NET
Spire.PDF for .NET is a library for reading, creating, and processing PDF files in .NET applications. This article uses its document loading, page reordering, and file saving APIs.
Run the following command in the NuGet Package Manager Console in Visual Studio:
Install - Package Spire .…