Stampa commenti durante il salvataggio in PDF
Microsoft Excel consente di stampare i commenti durante la stampa o il salvataggio nel formato PDF con le seguenti opzioni
- Nessuna
- Alla fine del foglio
- Come visualizzato nel foglio
Stampa commenti durante il salvataggio in PDF
Aspose.Cells fornisce le seguenti enumerazioni per supportare la stampa dei commenti durante il salvataggio in PDF
- PrintCommentsType.PRINT_NO_COMMENTS
- PrintCommentsType.PRINT_IN_PLACE
- PrintCommentsType.PRINT_SHEET_END
Estratto del Codice
Il seguente codice di esempio illustra come utilizzare l’enumerazione PrintCommentsType per stampare i commenti durante il salvataggio in 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"); |