I’m attempting to take a single sheet from a workbook and convert it to pdf. The sheet has a chart. The data for the chart is on a different sheet that I do not want included in the pdf. My approach is to copy the sheet that I want to a new workbook and then save the workbook as a PDF. However, the data on the chart is not included in the pdf with this approach. I confirmed that the chart was still rendered when using v. 188.8.131.52. I am using version 17.3.0.
Workbook sourceWorkbook = new Workbook(Files.newInputStream(path));
Worksheet sourceSheet = sourceWorkbook.getWorksheets().get(“Valuation”);
Workbook workbookToPDF = new Workbook();
PdfSaveOptions saveOptions = new PdfSaveOptions(SaveFormat.PDF);
String pdfPath = “Test.pdf”;