PDFへ保存する際にコメントを印刷する

PDFへ保存する際にコメントを印刷する

Aspose.Cellsは、PDFに保存する際にコメントを印刷するための次の列挙型を提供します

コードスニペット

以下のサンプルコードは、PrintCommentsType列挙型を使用してPDFに保存する際にコメントを印刷する方法を示しています。

// 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");

関連記事