I want to use documents4j to convert Excel files to PDF but there are two issues:
- I must open an Excel file when convert. When I convert Word to PDF, I didn't need open a doc/docx file.
- The PDFs are not containing a chart imagewhich is contained in Excel.
How can I resolve this? Here is code that reproduces the issue:
private void convertExcelToPDF1() throws Exception {
InputStream excelFileIS = new BufferedInputStream(new FileInputStream("C:\\test_convert\\test.xlsx"));
File target = new File("C:\\test_convert\\sim_status_excel.pdf");
IConverter converter = RemoteConverter.builder()
.baseFolder(new File("D:\\temp"))
.workerPool(20, 25, 2, TimeUnit.SECONDS)
.requestTimeout(10, TimeUnit.SECONDS)
.baseUri("http://localhost:9998")
.build();
Future<Boolean> conversion = converter.convert(excelFileIS).as(DocumentType.XLSX)
.to(target).as(DocumentType.PDF)
.prioritizeWith(1000)
.schedule();
}