Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active October 27, 2019 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/4cd8ebab852c7c6d86bcbd1172d9ba64 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/4cd8ebab852c7c6d86bcbd1172d9ba64 to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/GroupDocs-Merger/GroupDocs.Merger-for-Java
InputStream documentExample = new FileInputStream("./Data/Storage/sample.pdf");
// Specify current and new page numbers
int pageNumber = 6;
int newPageNumber = 1;
// Main method.
DocumentResult result = new DocumentHandler().movePage(documentExample, pageNumber, newPageNumber);
// Save the resultant document
CommonUtilities.saveDocument("./Data/Output/result.pdf",result.getStream());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment