Hi Team,
PDF bookmarks were generated when using 7.5.0.3 along with below code. But with Latest Aspose.Cells 8.0.0 this bookmarks are not generated.
I believe this is a regression.
Code:
Workbook doc = new Workbook(excel_file);
com.aspose.cells.PdfSaveOptions saveOptions = new com.aspose.cells.PdfSaveOptions();
PdfBookmarkEntry bookmarkEntry = new PdfBookmarkEntry();
Cell firstCell = workbook.getWorksheets().get(0).getCells().getFirstCell();
bookmarkEntry.setText(workbook.getFileName().substring(workbook.getFileName().lastIndexOf("\\") + 1));
bookmarkEntry.setDestination(firstCell);
bookmarkEntry.setOpen(false);
Cell cell = null;
PdfBookmarkEntry subBookmarks = null;
ArrayList list = new ArrayList();
for (int i = 0; i < workbook.getWorksheets().getCount(); i++) {
cell = workbook.getWorksheets().get(i).getCells().getFirstCell();
subBookmarks = new PdfBookmarkEntry();
subBookmarks.setText(workbook.getWorksheets().get(i).getName());
subBookmarks.setDestination(cell);
list.add(subBookmarks);
}
bookmarkEntry.setSubEntry(list);
pso.setPdfBookmark(bookmarkEntry); or pso.setBookmark(bookmarkEntry).
Please let me know if I am missing something or there needs any code changes for latest Aspose.Cells 8.0.0.
Attached PDF output from 7.5.0.3
Thanks,
Satyendra