Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Apr 08, 2022 3:19 pm

Hi,

I'm using your library to generate a pdf file from an excel file.
I just try to add a logo on my excel and it works properly when I am running my .net5 API on Windows 10.
But, when I deploy the same code on AWS there is an error when the logo is added to the excel file.
The only difference between the two environments are that I am using Windows 10 on my local computer but I deploy it on a Linux VM.

The exception thrown is :
sprḯ: Unknown image format:Parameter is not valid.
at spr₧.ᜀ(Stream A_0)
at spr₰.ᜀ(Stream A_0)
at spr₮.ᜀ(spr₍ A_0, Stream A_1)
at spr₎.ᜀ(spr₍ A_0, Stream A_1)
at spr₎.ᜀ(Int32 A_0, Int32 A_1, Stream A_2, Int32 A_3, Int32 A_4)
at spr⁸.ᜀ(Int32 A_0, Int32 A_1, Stream A_2, Int32 A_3, Int32 A_4)
at sprᢔ.ᜀ(Stream A_0, Int32 A_1, Int32 A_2, Int32 A_3, Int32 A_4)
at sprᢔ.ᜀ(Image A_0, ImageFormatType A_1, Int32 A_2, Int32 A_3, Int32 A_4, Int32 A_5)
at sprᢔ.ᜀ(Image A_0, ImageFormatType A_1, Int32 A_2, Int32 A_3)
at Spire.Xls.Core.Spreadsheet.Collections.XlsPicturesCollection.Add(Int32 topRow, Int32 leftColumn, Image image, ImageFormatType imageFormat)

Kindly,
Alexandre

sobral91
 
Posts: 2
Joined: Fri Apr 08, 2022 3:12 pm

Mon Apr 11, 2022 5:48 am

Hello,

Thank you for your inquiry.
To help us investigate your issue quickly and efficiently, please provide the following information. You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
1) Your inputl files (contains the excel file and the image file to be added).
2) Your complete test code.
3) Your Linux system information, such as Ubuntu-20.04.3.
4) Are you deploying a project running on Windows 10 directly to Linux?

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Tue Apr 12, 2022 9:55 am

Hello Annika,

I sent you the details by email.
I am looking forward your investigation.

Thank you in advance,

Alexandre

sobral91
 
Posts: 2
Joined: Fri Apr 08, 2022 3:12 pm

Tue Apr 12, 2022 10:30 am

Hello,

Thanks for sharing the information via email.
I will conduct an investigation based on the information you provided, and once there is a result, I will inform you in time. Thanks for your understanding.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Thu Apr 14, 2022 8:26 am

Hello,

Thanks for your patience.
I tested your case, but did not reproduce the issue you mentioned. I suggest you to use our latest version of Spire.Officefor.NETStandard 7.3.2 and modify the code for adding images to the following code, then test it again. If the issue still exists after testing, please provide your full test project (simple project that reproduces your issue) for us to investigate further. Thanks in advance.
Code: Select all
...
 await using Stream logoStream = await GetLogoStreamByCoachIdAsync(coachId);

 if (logoStream != null)
 {
     var picture = sheet.Pictures.Add(2, 1, logoStream);
     ...
 }
...

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS

cron