Stampa Commenti durante il salvataggio in PDF con Node.js tramite C++
Microsoft Excel consente di stampare i commenti durante la stampa o il salvataggio nel formato PDF con le seguenti opzioni
- Nessuna
- Alla fine del foglio
- Come visualizzato nel foglio
Aspose.Cells fornisce l’enum PrintCommentsType per supportare la stessa funzione. L’enum PrintCommentsType ha i seguenti membri.
- PrintNoComments
- PrintInPlace
- PrintSheetEnd
Stampa commenti durante il salvataggio in PDF
Il seguente esempio di codice illustra come usare PrintCommentsType per stampare commenti durante il salvataggio in 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);
/*
* For print no comments use "PrintCommentsType.PrintNoComments"
* and for print the comments as displayed on sheet use "PrintCommentsType.PrintInPlace"
* For Print the comments at the end of sheet we use "PrintCommentsType.PrintSheetEnd"
*/
worksheet.getPageSetup().setPrintComments(AsposeCells.PrintCommentsType.PrintSheetEnd);
// Save workbook in pdf format
workbook.save(path.join(dataDir, "PrintCommentWhileSavingToPdf_out.pdf"));