Hi Aspose Team,
Thank you for your help, We had tried with below code
private void processExcel() {
String input = “E:\sample\9149.pdf”;
InputStream is = null;
try {
File licFile = new File(“E:\sample\GenerateExcel\src\Aspose_Total.lic”);
is = new FileInputStream(licFile);
License lic = new License();
lic.setLicense(is);
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
} finally {
try {
if (is != null)
is.close();
} catch (Exception ignored) {
}
}
try
{
Document pdfDocument = new Document(input);
ExcelSaveOptions excelsave = new ExcelSaveOptions();
pdfDocument.save("E:\\sample\\test123.xls", excelsave);
Document doc = new Document(input);
ExcelSaveOptions options1 = new ExcelSaveOptions();
options1.setFormat(ExcelSaveOptions.ExcelFormat.XLSX);
doc.save("E:\\sample\\test1.xlsx", options1);
System.out.println("end");
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
}
}
XLS format output was generated(attached generated output test123.xls) but it is like excel file not template format, we need excel output with given template format (like excel_template.xls attached)
and we are getting below error while executing the above code to generate xlsx format file. We are using aspose.pdf-18.6-java.jar
Exception in thread “main” java.lang.NoSuchMethodError: com.aspose.pdf.ExcelSaveOptions.setFormat(I)V
at com.javacodegeeks.example.HelloWorldApplication.processExcel(HelloWorldApplication.java:79)
at com.javacodegeeks.example.HelloWorldApplication.main(HelloWorldApplication.java:30)
Can you please provide sample code for generating an excel template file with input as a pdf or XML
Files.zip (107.8 KB)
file.
Thanks,
Durga