Skriv ut kommentarer samtidigt som du sparar till PDF
Contents
[
Hide
]
Microsoft Excel låter dig skriva ut kommentarer medan du skriver ut eller sparar till PDF-format med följande alternativ
- Ingen
- I slutet av arket
- Som visas på arket
Aspose.Cells tillhandahållaPrintCommentsType enum för att stödja samma funktion. DePrintCommentsTypeenum har följande medlemmar
- Skriv ut Inga kommentarer
- PrintInPlace
- PrintSheetEnd
Skriv ut kommentarer samtidigt som du sparar till PDF
Följande exempelkod illustrerar hur du använderPrintCommentsTypeför att skriva ut kommentarer samtidigt som du sparar till 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-.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"); |