Kommentare beim Speichern in PDF mit Node.js via C++ drucken
Microsoft Excel ermöglicht es Ihnen, Kommentare beim Drucken oder Speichern im PDF-Format mit den folgenden Optionen zu drucken:
- Keine
- Am Ende des Blattes
- Wie auf dem Blatt angezeigt
Aspose.Cells bietet das PrintCommentsType Enum zur Unterstützung derselben Funktion. Das PrintCommentsType Enum hat die folgenden Mitglieder
- PrintNoComments
- PrintInPlace
- PrintSheetEnd
Kommentare drucken beim Speichern als PDF
Das folgende Beispiel zeigt, wie PrintCommentsType verwendet wird, um Kommentare beim Speichern in PDF zu drucken.
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"));