Rendera fast linje när du konverterar Excel till PDF
Contents
[
Hide
]
För kompatibilitet med äldre versioner renderar Aspose.Cells rutnätet som en prickad linje som standard vid konvertering av Excel till PDF. Men moderna Excel renderar rutnätet som en solid linje nu för tiden.
Med alternativet PdfSaveOptions.GridlineTypes kan Aspose.Cells också rendera rutnätet som en solid linje.
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 | |
// Create an empty Workbook | |
Workbook wb = new Workbook(); | |
//Prepare data | |
wb.Worksheets[0].Cells["D9"].PutValue("gridline"); | |
//Enable to print gridline | |
wb.Worksheets[0].PageSetup.PrintGridlines = true; | |
//Set to render gridline as solid line | |
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(); | |
pdfSaveOptions.GridlineType = GridlineType.Hair; | |
// Save the pdf file with PdfSaveOptions | |
wb.Save(TMP_DIR + "test_Cs.pdf", pdfSaveOptions); |