Imprimir comentarios al guardar en PDF con Node.js via C++
Microsoft Excel te permite imprimir comentarios al imprimir o guardar en formato PDF con las siguientes opciones
- Ninguno
- Al final de la hoja
- Según se muestra en la hoja
Aspose.Cells proporciona la enumeración PrintCommentsType para soportar la misma función. La enumeración PrintCommentsType tiene los siguientes miembros
- PrintNoComments
- PrintInPlace
- PrintSheetEnd
Imprimir comentarios al guardar en PDF
El siguiente código de ejemplo ilustra cómo usar PrintCommentsType para imprimir comentarios al guardar en 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"));