Convert to PDF not working always

Pageborder setting is sometimes taken and sometimes not into considering due to which excel is not properly getting converted to PDF.

string pdfReport = reportFullName.Replace(fileExtn, “.pdf”);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(SaveFormat.Pdf);
pdfSaveOptions.CalculateFormula = true;
reportWorkbook.Save(pdfReport, pdfSaveOptions);

@SubbuatAspose,

Thanks for your query.

Please share your sample source Excel file, output PDF file and an expected output PDF generated using Excel with us for our testing. Provide some image as well showing the problem area. We will reproduce the problem and provide our feedback after analysis.

T2UKSM - Summary Risk Report 30 07 2018.pdf (158.0 KB)
ZAL003 - Summary Risk Report 30 07 2018.pdf (181.5 KB)
Risk Reports.zip (342.1 KB)

Thanks for the reply. Here are the example files.

What I observed is, code is sometimes ignore the excel preexisting settings (like page break etc) when converting to PDF. And sometimes it is considering. Strange.

@SubbuatAspose,

Thanks for your query.

I have tested this issue using latest version Aspose.Cells for .NET 18.8 and observed no issue. PDF files are generated for both the source XLSM files, similar to the PDF files generated by Excel 2016. You may please try the scenario using latest version and provide the feedback.

ZAL003 - Summary Risk Report 30 07 2018ByExcel.pdf (237.2 KB)
ZAL003 - Summary Risk Report 30 07 2018ByAspose.pdf (117.9 KB)
T2UKSM - Summary Risk Report 30 07 2018ByAspose.pdf (118.3 KB)
T2UKSM - Summary Risk Report 30 07 2018ByExcel.pdf (237.4 KB)

Hi Team,

Missed to explain the problem fully. I have a template where I update the date in run time and save one tab by moving out to a new book. and while saving i need pdf copy as well. This is where code is behaving strange, not taking source template settings into consider while converting to PDF. Attached is the template i use.xLiquidity - Risk Report Template.zip (2.6 MB)

@SubbuatAspose,

I am afraid that I am not able to understand the steps to reproduce the issue. Please provide us detailed steps for reproducing this issue. Once we are able to observe the issue, we will provide our feedback.