PDF に保存しながらコメントを印刷
Contents
[
Hide
]
Microsoft Excel では、次のオプションを使用して PDF 形式で印刷または保存するときにコメントを印刷できます。
- なし
- シートの最後に
- シートに表示されているとおり
PDF に保存しながらコメントを印刷
Aspose.Cells は、PDF の保存中にコメントを印刷できるように、次の列挙型を提供します。
- PrintCommentsType.PRINT_NO_COMMENTS
- PrintCommentsType.PRINT_IN_PLACE
- PrintCommentsType.PRINT_SHEET_END
コードスニペット
次のサンプル コードは、使用方法を示しています。PrintCommentsType 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-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(PrintComments.class); | |
// Create a workbook from source Excel file | |
Workbook workbook = new Workbook(dataDir + "source.xlsx"); | |
// Access first worksheet | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Print no comments | |
worksheet.getPageSetup().setPrintComments(PrintCommentsType.PRINT_NO_COMMENTS); | |
// Print the comments as displayed on sheet | |
worksheet.getPageSetup().setPrintComments(PrintCommentsType.PRINT_IN_PLACE); | |
// Print the comments at the end of sheet | |
worksheet.getPageSetup().setPrintComments(PrintCommentsType.PRINT_SHEET_END); | |
// Save workbook in pdf format | |
workbook.save(dataDir + "out.pdf"); |