Node.js ile C++ kullanarak PDF’ye kaydederken Yorumları Yazdırın
Contents
[
Hide
]
Microsoft Excel, aşağıdaki seçeneklerle PDF biçimine yazdırırken veya kaydederken yorumları yazdırmanıza izin verir
- Hiçbiri
- Sayfa sonunda
- Sayfada gösterildiği gibi
Aspose.Cells, aynı özelliği desteklemek için PrintCommentsType enumunu sağlar. PrintCommentsType enumunun üyeleri şunlardır
- PrintNoComments
- PrintInPlace
- PrintSheetEnd
PDF’ye kaydederken yorumları yazdır
Aşağıdaki örnek kod, yorumları PDF’ye kaydederken nasıl kullanılacağını gösterir PrintCommentsType kullanımı.
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"));