Mostrar línea de cuadrícula sólida al convertir Excel a PDF

Contents
[ ]

Para garantizar la compatibilidad con versiones anteriores, Aspose.Cells renderiza las líneas de cuadrícula como líneas punteadas de forma predeterminada al convertir Excel a PDF. Sin embargo, Excel moderno renderiza las líneas de cuadrícula como líneas sólidas en la actualidad.

Con la opción PdfSaveOptions.GridlineTypes, Aspose.Cells también puede representar la línea de cuadrícula como una línea sólida.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// Create an empty Workbook
Workbook wb = new Workbook();
//Prepare data
wb.getWorksheets().get(0).getCells().get("D9").putValue("gridline");
//Enable to print gridline
wb.getWorksheets().get(0).getPageSetup().setPrintGridlines(true);
//Set to render gridline as solid line
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setGridlineType(GridlineType.HAIR);
// Save the pdf file with PdfSaveOptions
wb.save("output.pdf", pdfSaveOptions);

solid-gridline.png