Imprimer les commentaires lors de l enregistrement au format PDF
Microsoft Excel permet d’imprimer les commentaires lors de l’impression ou de l’enregistrement au format PDF avec les options suivantes
- Aucun
- À la fin de la feuille
- Tel qu’affiché sur la feuille
Imprimer les commentaires lors de l’enregistrement au format PDF
Aspose.Cells fournit les énumérations suivantes pour prendre en charge l’impression de commentaires lors de l’enregistrement en PDF
- PrintCommentsType.PRINT_NO_COMMENTS
- PrintCommentsType.PRINT_IN_PLACE
- PrintCommentsType.PRINT_SHEET_END
Extrait de code
Le code d’exemple suivant illustre comment utiliser l’énumération PrintCommentsType pour imprimer des commentaires lors de l’enregistrement en 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"); |