Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created April 25, 2019 15:44
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/c5d682dc8ba12d4f10cf4f26910d34a0 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/c5d682dc8ba12d4f10cf4f26910d34a0 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
String sourceFile = CommonUtilities.sourcePath + fileName;
// Preparing.
String password = "SomePasswordString";
List<Integer> pageNumbersForRotation = new ArrayList<Integer>();
pageNumbersForRotation.add(3);
pageNumbersForRotation.add(6);
RotateOptions pagesOptions = new RotateOptions(FileFormat.Vsdx, password, RotateMode.Rotate180, pageNumbersForRotation );
InputStream documentExample = new FileInputStream(sourceFile);
// Main method.
DocumentResult result = new DocumentHandler().rotatePages(documentExample, pagesOptions);
OutputStream documentStream = result.getStream();
CommonUtilities.saveDocument((ByteArrayOutputStream)documentStream, fileName);
System.out.print(result.getFileFormat());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment