Render Solid Gridline while converting Excel to PDF

Contents
[ ]

For compatibility with older versions, Aspose.Cells renders gridline as dotted line by default while converting Excel to PDF. However, modern Excel renders gridline as solid line in nowadays.

With option PdfSaveOptions.GridlineTypes, Aspose.Cells can also render gridline as solid line.

// 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);

solid-gridline.png