Cell borders are missing when aspose cells convert excel to pdf

when Im trying to convert excel to pdf the cell border are missing. Just it is displaying only content.

This is the code i have used for the conversion.

com.aspose.cells.Workbook book = new com.aspose.cells.Workbook(srcFilePath);
book.save(destFilePath,com.aspose.cells.SaveFormat.PDF);

here even Im attaching the document which will show both files(Excel and PDF). It is converting succesfully to pdf but all the cells margings are missing.Converting Excel Docs to PDF (3).zip (168.9 KB)

@dineshreddydepa

Thanks for using Aspose APIs.

Please provide us your Excel file and the output PDF as you have shown in MS-Word file. Please also provide us your sample code. You should also give a try to most recent version i.e. 18.6 and see how it goes.

we are using java programming language.I have tried using the latest version (18.5).
I have already send you the sample code.
This is the code i’m using to convert excel to PDF.

com.aspose.cells.Workbook book = new com.aspose.cells.Workbook(srcFilePath);
book.save(destFilePath,com.aspose.cells.SaveFormat.PDF);

here are our environment details.
java 7 32 bit version
aspose-cells-18.5.jar(this is the latest one i found in your repositary)

I’m sending you the sample excel file and conveted file pdf.StudyDocument_5578.pdf (54.8 KB)
Documents.zip (61.7 KB)

@dineshreddydepa,

Thanks for the template file, output PDF and sample code.

You meant gridlines are not rendered with contents, is not it? Well, if you could open your template file into MS Excel and take the print preview of the worksheet in MS Excel manually, you will also notice that those gridlines borders are not shown too. The gridlines (borders) are only for display purpose only when opening into MS Excel manually. Aspose.Cells does render Excel to PDF based on what is shown in print preview of the worksheets. If you need to print the gridlines with data, you may try the following lines (in bold) of code:
e.g
Sample code:

com.aspose.cells.Workbook book = new com.aspose.cells.Workbook(srcFilePath);
for(int i = 0; i< book.getWorksheets().getCount(); i++)
{
book.getWorksheets().get(i).getPageSetup().setPrintGridlines(true);
}
book.save(destFilePath,com.aspose.cells.SaveFormat.PDF);

Hope, this helps a bit.

Thanks. you solved our issue.

@dineshreddydepa,

Good to know that your issue is sorted out by the suggested code. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.