// For complete examples and data files, please go to https://github.com/groupdocs-conversion/GroupDocs.Conversion-for-Java
// Instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(Utilities.getConfiguration());
// Set password to unprotect protected document during loading
LoadOptions loadOptions = new LoadOptions();
loadOptions.setPassword("secret");
// Convert starting from page 2 and convert 2 pages,
// use DPI 300, page width 1024, page height 768
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setPageNumber(2);
saveOptions.setNumPagesToConvert(2);
saveOptions.setDpi(300);
saveOptions.setWidth(1024);
saveOptions.setHeight(768);
saveOptions.setOutputType(OutputType.String);
String convertedDocumentPath = conversionHandler.<String> convert(fileName, loadOptions, saveOptions);