Kommentare beim Speichern in PDF drucken
Microsoft Excel ermöglicht es Ihnen, Kommentare beim Drucken oder Speichern im PDF-Format mit den folgenden Optionen zu drucken:
- Keine
- Am Ende des Blattes
- Wie auf dem Blatt angezeigt
Aspose.Cells bieten das PrintCommentsType Enum zur Unterstützung dieser Funktion. Das PrintCommentsType Enum enthält die folgenden Elemente
- PrintNoComments
- PrintInPlace
- PrintSheetEnd
Kommentare drucken beim Speichern als PDF
Der folgende Beispielcode veranschaulicht, wie PrintCommentsType verwendet wird, um Kommentare beim Speichern als PDF zu drucken.
// 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"); |