Print Comments while saving to PDF with Node.js via C++

The following sample code illustrates how to use PrintCommentsType to print comments while saving to PDF.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Create a workbook from the source Excel file
const workbook = new AsposeCells.Workbook(path.join(dataDir, "SampleWorkbookWithComments.xlsx"));

// Access the first worksheet
const worksheet = workbook.getWorksheets().get(0);

/*
* To print no comments, use "PrintCommentsType.PrintNoComments".
* To print the comments as displayed on the sheet, use "PrintCommentsType.PrintInPlace".
* To print the comments at the end of the sheet, use "PrintCommentsType.PrintSheetEnd".
*/
worksheet.getPageSetup().setPrintComments(AsposeCells.PrintCommentsType.PrintSheetEnd);

// Save the workbook in PDF format
workbook.save(path.join(dataDir, "PrintCommentWhileSavingToPdf_out.pdf"));