Hi everyone, I'm new in this area...so maybe i'm doing something wrong but i can't convert a XSLX file to a PDF file...I'm following the example on the web:
[code]
protected async Task ConvertXlsToPdf(string filename)
{
byte[] fileStream = await FileHandler.LoadFile(filename, DependencyService.Get().GetDownloadFolder());
Stream stream = new MemoryStream(fileStream);
using (ExcelEngine excelEngine = new ExcelEngine())
{
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Open(stream);
XlsIORenderer renderer = new XlsIORenderer();
PdfDocument pdfDocument = renderer.ConvertToPDF(workbook);
//Save the PDF document to stream.
MemoryStream stream2 = new MemoryStream();
pdfDocument.Save(stream2);
return stream2;
}
}
[/code]
It freezes on this line
IWorkbook workbook = application.Workbooks.Open(stream);
I attached my xlsx file for test
Thanks!
Attachment:
test_c59d087d.rar