C# code below
var file = Path.Combine(webRootPath, "data\\Allsvenskan2001.xlsx"); var pkg = new ExcelPackage(file); using var ms = new MemoryStream(); pck.Workbook.SaveAsPdf(ms); return File(ms.ToArray(), "application/pdf", "EPPlus Sample 4.pdf");