You can also convert the Word document PDF without using the cloud storage using ConvertDocument API method. Please check the sample Java code for reference.
// Get Client ID and Client Secret from https://dashboard.aspose.cloud/
WordsApi wordsApi = new WordsApi("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxxxx","https://api.aspose.cloud");
try {
ConvertDocumentRequest request = new ConvertDocumentRequest(
Files.readAllBytes(Paths.get("C:/Temp/02_pages.docx").toAbsolutePath()),
"pdf",
null,
null,
null,
null
);
File result = wordsApi.convertDocument(request);
System.out.println("api request completed...");
File dest = new File("C:/Temp/02_pages_java.pdf");
Files.copy(result.toPath(), dest.toPath(),
java.nio.file.StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}