保存到 PDF 时打印评论
Contents
[
Hide
]
Microsoft Excel 允许您在使用以下选项打印或保存为 PDF 格式时打印注释
- 没有任何
- 在工作表的末尾
- 如表所示
Aspose.Cells 提供打印注释类型枚举以支持相同的功能。这打印注释类型枚举有以下成员
- 打印无评论
- 就地打印
- 打印页结束
保存到 PDF 时打印评论
下面的示例代码说明了如何使用打印注释类型在保存到 PDF 时打印注释。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create a workbook from source Excel file | |
Workbook workbook = new Workbook(dataDir + "SampleWorkbookWithComments.xlsx"); | |
// Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[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.PageSetup.PrintComments = PrintCommentsType.PrintSheetEnd; | |
// Save workbook in pdf format | |
workbook.Save(dataDir + "PrintCommentWhileSavingToPdf_out.pdf"); |