Hello,
I was going through the documentation of workbook.dispose() method. I could not get much details in the java docs for this method.
Can you provide some details regarding when to use workbook.dispose().
For example, consider the following sample code to convert chart to pdf:
private static void chartToPDF() throws Exception {
Workbook workbook = new Workbook(“test.xlsx”);
WorksheetCollection ws = workbook.getWorksheets();
Chart chart = workbook.getWorksheets().get(0).getCharts().get(“Chart 1”);
chart.toPdf(“D:\test.pdf”);
workbook.dispose();
}
Here I am creating a new Workbook object, extracting a chart and converting it to pdf. Do I need to always release resources using workbook.dispose() method when the Workbook object is no more needed.
Can you tell me in detail the specific scenarios in which this method should be used.