fileNameNew = fileNameOld.Replace(".pdf", ".xls");
saveOptions.InsertBlankColumnAtFirst = false;
saveOptions.MinimizeTheNumberOfWorksheets = true;
pdfDocument.Save(uploadFolder + @"\" + fileNameNew, saveOptions);
Hi Oliver,
Thanks for contacting support. I have opened your shared Excel document in MS Excel 2010 and noticed the warning which you have mentioned. I would like to share with you that the warning you are facing is an expected behavior of the API. Please note that Aspose.Pdf supports generating Excel file from PDF in MS Excel 2003 format. So when you open the file in later versions of MS Excel it will prompt such warning.
However in order to avoid the warning in higher versions, you may save the PDF into XML format. Please check the following code snippet to save the PDF file into XML format using ExcelSaveOptions.
Document doc = new Document(dataDir + “SamplePDF.pdf”);
ExcelSaveOptions options = new ExcelSaveOptions();
doc.Save(dataDir + "SampleExcel.xml", options);
Generated output file from the above code can be opened into MS Excel without showing any warning. In case of any further query please feel free to ask.
Best Regards,
We would like to share with you that you can generate XLSX files directly from PDF using Aspose.PDF for .NET. Please check following code snippet in order to achieve that:
Document document = new Document(dataDir + "Input.pdf");
ExcelSaveOptions saveOptions = new ExcelSaveOptions();
saveOptions.Format = ExcelSaveOptions.ExcelFormat.XLSX;
// optional settings
saveOptions.InsertBlankColumnAtFirst = false;
saveOptions.MinimizeTheNumberOfWorksheets = true;
document.Save(dataDir + "output.xls", saveOptions);