I am using code bellow for sxw file to PDF conversion using aspose-words-14.11.0-java
public static byte[] textToPdf(byte[] byte_data) throws Exception {
InputStream in = (new ASC_Util().getClass().getClassLoader().getResourceAsStream("META-INF/Aspose.Total.Java.lic"));
com.aspose.words.License license = new com.aspose.words.License();
license.setLicense(in);
com.aspose.words.DocumentBuilder obj_docBuilder = new com.aspose.words.DocumentBuilder();
obj_docBuilder.write(new String(byte_data));
ByteArrayOutputStream bos = new ByteArrayOutputStream();
obj_docBuilder.getDocument().save(bos, new PdfSaveOptions());
in.close();
return bos.toByteArray();
}
Converted document has a larg number of pages while input has only 2. both files are attaced