Move Pages in PDF using GroupDocs.Merger for .NET and Java

If you are a regular user of Word Processing, Spreadsheet, Presentation and PDF documents, you can understand how struggling the task of typing up these documents is. Considering the efforts that requires just in the area of typing, formatting and correcting the layout is significantly difficult as it usually requires multiple clicks to complete a simple task of formatting.

Although some documents tool creates new pages automatically, as needed, but it is quite difficult to move pages within the documents. Consider a scenario where you have just completed a long report. It includes sections, graphs, tables, and images. You received a feedback from your manager that the content on a page which should have been a part of another one. You realize that it is not easy to copy-paste the material as it contains different images that need to be taken care of. What will you do?

Either you can go for the long procedure of selecting the navigation panel, clicking multiple buttons, and then achieve your purpose or you can use just a line of code to do it all for you. If you are not a regular user of these documents, then you can opt for the long procedure. However, there is a simple way to complete this task.

Move Pages in PDF using GroupDocs.Merger

If most of the documents of your company rely on on the tools mentioned above, you should consider making this task simpler for yourself by using GroupDocs.Merger. GroupDocs.Merger is easy-to-use API and available in both .NET and Java, which allows you to manipulate document structure and rearrange pages through its MovePage option. Instead of clicking on multiple buttons to complete a small task of moving pages, follow these simple steps to achieve your purpose:

  • Specify current and new page numbers
  • Load you desired document
  • Call MovePage method with MoveOptions
  • Save the resultant document

Following code demonstrates how a PDF document page can be moved using GroupDocs.Merger for .NET:

Java developers can move page in a PDF document using GroupDocs.Merger for Java with following line of codes:

See the following screenshots of source and resultant PDF documents: