when I am tested in the local server it’s working filne. But in AWS It’s return wrong output.
Document document = new Document(filePath);
// for test
TxtSaveOptions options = new TxtSaveOptions();
options.setSaveFormat(com.aspose.words.SaveFormat.TEXT);
options.setEncoding(java.nio.charset.Charset.forName("UTF-8"));
options.setExportHeadersFooters(false);
options.setParagraphBreak("\n");
options.setPreserveTableLayout(false);
options.setPrettyFormat(true);
document.save(name, options);
//document.save(name);
// file data return as a string
File outputFile = new File(name);
String base64 = null;
if (outputFile != null)
{
FileInputStream fis = null;
fis = new FileInputStream(outputFile);
byte[] bytes = new byte[(int)outputFile.length()];
fis.read(bytes);
base64 = new sun.misc.BASE64Encoder().encode(bytes);
fis.close();
}
//byte[] base64 = Base64.encodeBase64(document.getText().getBytes());
documentData.setFileData(new String(base64));
// find page count
documentData.setTotalNumberOfPages(document.getPageCount());