Hello,
I am using Aspose.Cells v17.5.5 to generated PDF/PNG of chart - ‘Chart 1’ in the attached excel file. In case of PDF, blank output is generated and in case of PNG, a PNG of zero bytes is generated.
Following code is used to generate the PDF:
Workbook workbook = new Workbook(“test.xlsx”);
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = “Sheet1”;
Chart chart = ws.get(worksheetName).getCharts().get(“Chart 1”);
chart.toPdf(“aspose response.pdf”);
Following code is used to generate the PNG:
Workbook workbook = new Workbook(“test.xlsx”);
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = “Sheet1”;
Chart chart = ws.get(worksheetName).getCharts().get(“Chart 1”);
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.setImageFormat(ImageFormat.getPng());
chart.toImage(“aspose response.png”, imgOptions);
Can you please analyze this issue.
Thanks,
Neha