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.

Wed Feb 19, 2025 6:16 am

Dear Spire Support Team,

I am using Spire.XLS to convert Excel files to PDF. While the conversion works correctly on Windows, I am experiencing an issue where the cell width is rendered differently on Linux.

### Issue Summary
- In Spire.XLS 12.10.1, the cell width is about **95% narrower** on Linux.
- In Spire.XLS 14.12.2, the cell width is about **130% wider** on Linux.
- On Windows, both versions produce correct results.

### Environment
- **LinuxOS:** Debian GNU/Linux 12 (bookworm) / .NET 8.0.13
- **WindowsOS:** Windows10 / .NET 8.0.13
- **Fonts:** we set the font directory explicitly using `CustomFontFileDirectory`.
- **Settings Tested:** Adjusting `DPI` and `PdfConformanceLevel` did not resolve the issue.


### Attachments
- Input Excel file
- PDF output from Windows & Linux for comparison
- Sample code
The Sample code could not be attached because of an error. Can you tell me how to send it?

Could you please provide any insights, solutions, or workarounds for this issue?
Looking forward to your response.

Best regards,
Attachments
Attachments.zip
(1.42 MiB) Downloaded 1115 times

nobu_441
 
Posts: 11
Joined: Fri Feb 08, 2019 2:12 pm

Wed Feb 19, 2025 9:59 am

Hi,

Thanks for your inquriy.
I conducted preliminary testing on CentOS and was unable to reproduce your issue. I will set up a Debian server similar to yours to try and get back to you as soon as possible.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Thu Feb 20, 2025 4:09 am

Hi,

I have tested in the exact same environment as you (Debian 12 bookworm), but still cannot reproduce your problem. I have uploaded my project here, which also includes the font folder. Please verify my project in your server and check the result. Looking forward to your feedback.

Sincerely,
Nina
E-iceblue support team
Attachments
output-debian.zip
(969.31 KiB) Downloaded 1073 times
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Fri Feb 21, 2025 4:40 am

Hi Nina,

Thank you for your response and for testing in the same environment.

I would like to send you my project, which includes the exact settings and font files we are using. However, the file size exceeds **2MB**, so I am unable to attach it directly.

Could you please let me know an alternative way to share the file with you?
For example, can I upload it to a file-sharing service and provide a download link?

Additionally, I should mention that we are running the conversion inside a **Docker container**. This might affect the rendering behavior.

Looking forward to your instructions.

Best regards.

nobu_441
 
Posts: 11
Joined: Fri Feb 08, 2019 2:12 pm

Fri Feb 21, 2025 7:55 am

Hi,

Yes, you can upload your file via OneDrive server and share the download link here or send to my email ([email protected]). It would be better if you could also provide your dockerfile.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Tue Feb 25, 2025 4:43 am

Hi,

Sorry for the delayed response.
I have sent the project files, including the Dockerfile, to Nina via email.
Please let me know if any further information is needed.

Best regards,

nobu_441
 
Posts: 11
Joined: Fri Feb 08, 2019 2:12 pm

Tue Feb 25, 2025 9:40 am

Hi,

I have received the file you sent me via email.
I did reproduce your problem after testing in the docker container, but the degree of stretching in my content is not as severe as you provided. Attached are the results I generated in Windows and Docker for your reference. This issue has been handed over to our dev team for investigation and fixing, with the issue ID: SPIREXLS-5719. If there is any progress, I will notify you. Apologize for the inconvenience caused.

Sincerely,
Nina
E-iceblue support team
Attachments
docker-output.zip
(1.08 MiB) Downloaded 1161 times
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Wed Feb 26, 2025 1:04 am

Hi,

Thank you for reproducing the issue and forwarding it to the dev team. I appreciate your support.

I have reviewed the PDF file you provided. As you mentioned, the difference in cell width in your reproduction is less severe than in my environment. This makes me wonder if there might be an issue with my specific setup.

Could you please share the versions of **Spire.XLS** and any other related libraries you used when reproducing the issue?
Additionally, if there are any other libraries that might affect the rendering, please let me know their versions as well.

For reference, my environment includes:
- **Spire.XLS** 14.12.2 (netstandard2.0)
- **SkiaSharp** 2.88.9
- **SkiaSharp.NativeAssets.Linux.NoDependencies** 2.88.9

Looking forward to your response.

Best regards,

nobu_441
 
Posts: 11
Joined: Fri Feb 08, 2019 2:12 pm

Wed Feb 26, 2025 5:42 am

Hi,

Thanks for your feedback. Here are the steps I took to test your issue.
1. I installed Spire.XLSfor.NETStandard directly from Nuget rather than the localpackage in your project, I tested your version 14.12.2 and the 15.3.2, and the results are the same.

2. I directly build an image based on your Dockerfile on the debian, but it always throw exception when executing the command: RUN dotnet build "./SpireTeteer. csproj" - c Release - o/app/build. Therefore, I did not build SpireTester.csproj via your Dockerfile. Instead, I directly published the project to the linux-x64 directory in the Visual Studio tool and adjusted the Dockerfile to copy the linux-x64 directory into the container for testing. Please find attached my Dockerfile and testing steps for your reference.

1) Building an image based on my DockerFile:
Code: Select all
docker build -t spiretester .

2) Interactive Launch Container:
Code: Select all
docker run -it spiretester /bin/bash

3) After entering the container, execute the program:
Code: Select all
dotnet SpireTester.dll

4) Exit the container and copy the PDF file generated in the container to the host computer:
Code: Select all
exit
docker cp <container_id_or_name>:<container_path> <host_path>


Sincerely,
Nina
E-iceblue support team
Attachments
Dockerfile.zip
(240 Bytes) Downloaded 1007 times
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Thu Feb 27, 2025 11:51 pm

Hi,

Thank you for your detailed explanation and for testing the issue in different versions. I really appreciate your support.

Also, I realized that I didn’t mention this before, but in my case, I built the solution in **Visual Studio 2022** and also started the Docker container from within **Visual Studio 2022**. This might have influenced the behavior. I will test again using your method and compare the results.

Best regards,

nobu_441
 
Posts: 11
Joined: Fri Feb 08, 2019 2:12 pm

Fri Feb 28, 2025 2:10 am

Hi,

Okay, I will wait for your feedback on the test results.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Tue Apr 15, 2025 6:23 am

Hi,

Glad to inform you that the reported bug SPIREXLS-5719 has been resolved and the new version (Spire.XLS Pack(Hotfix) Version:15.4.0) is available. Please download the version from the link below and set the cultural information to ensure the correctness of the conversion effect.
Code: Select all
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ja-JP");
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfoByIetfLanguageTag("ja-JP");

Websit download link: https://www.e-iceblue.com/Download/download-excel-for-net-now.html
Nuget download link:https://www.nuget.org/packages/Spire.XLS/15.4.0
https://www.nuget.org/packages/Spire.XLSfor.NETStandard/15.4.0

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Thu Apr 24, 2025 4:18 am

Dear Support Team,

Thank you very much for your support.

I have re-checked the output in my local environment, and I’m happy to confirm that the issue with cell width expanding unexpectedly has been resolved. I really appreciate your help.

There is still a slight difference in cell height, but overall the output has improved significantly, and I’m satisfied with the result.

Thank you again, and I look forward to your continued support.

Best regards,

nobu_441
 
Posts: 11
Joined: Fri Feb 08, 2019 2:12 pm

Fri Apr 25, 2025 8:55 am

Hi,

Thanks for your feedback.
If you encounter any further issues or have additional suggestions, please don’t hesitate to reach out. Our team is always here to assist you.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.XLS