I converted A Excel file to A Image In C# but i found that the API i used is Only for windows btw i am using linux
using Spire.Xls;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System;
namespace Convert
{
class MainC
{
public static void Main(string[] args)
{
Workbook workbook = new Workbook();
workbook.LoadFromFile("Test121.xlsx", ExcelVersion.Version2013);
Worksheet worksheet = workbook.Worksheets[0];
using (MemoryStream ms = new MemoryStream())
{
worksheet.ToEMFStream(ms, 1, 1, worksheet.LastRow, worksheet.LastColumn);
Image image = Image.FromStream(ms);
Bitmap images = ResetResolution(image as Metafile, 300);
images.Save("Test121.jpg", ImageFormat.Jpeg);
}
}
}
}
Spire.XLS can be used on Linux. You do not need to install the msi, just download the hotfix version which only contains DLLs:
Then reference the DLLs under the netcoreappX.0 folder into your net core project.