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.

Tue Nov 05, 2024 1:42 pm

product version : Spire.XLS for .NET Free Edition Version:13.1.1.5046

When saving a file using worksheet1.SaveToPdf(save file name), the footer is different when saving it as a PDF using Excel as shown in the attached image and when saving it as a PDF using worksheet1.SaveToPdf(save file name).
When using worksheet1.SaveToPdf(save file name), the body of the file covers the footer.
Is there a solution?
Attachments
20241105_223728.jpg
20241105_223728.jpg (974.88 KiB) Viewed 30 times

zorro012
 
Posts: 6
Joined: Mon Apr 25, 2022 12:20 pm

Wed Nov 06, 2024 9:06 am

Hi,

Thanks for your message.
Since our commercial latest version 14.10.2 contains more fixes and is more stable, I recommend that you use our latest commercial version for testing. If you still encounter issues with the commercial version, please provide the test files for us to further investigate.
Spire.XLS Pack(Hotfix) Version:14.10.2: https://www.e-iceblue.com/Download/down ... t-now.html

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 416
Joined: Mon Nov 07, 2022 8:10 am

Thu Nov 07, 2024 12:49 am

The same symptom occurs even when using Spire.XLS Pack (Hotfix) Version:14.10.2 as you replied. I am sending you a test Excel file, so please check it.
Attachments
소독실시대장.zip
(48.92 KiB) Downloaded 12 times

zorro012
 
Posts: 6
Joined: Mon Apr 25, 2022 12:20 pm

Thu Nov 07, 2024 10:09 am

Hi,

Thank you for your sharing.
After investigation, this issue arises due to differences in regional formats. Please add the following code for testing before performing the conversion. After I added it, the conversion effect matched the image on the left.

Code: Select all
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ko-KR");


Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 416
Joined: Mon Nov 07, 2022 8:10 am

Thu Nov 07, 2024 10:50 am

Thank you for your reply.

I have the same problem even after applying the code you sent.

Is there any other solution?

zorro012
 
Posts: 6
Joined: Mon Apr 25, 2022 12:20 pm

Fri Nov 08, 2024 4:04 am

Hi,

I attached my project and output file for your reference. Please download it and run it directly.
If you still encounter issues during testing, please provide the following information for us to further investigate:

1. Operating System (e.g., Windows 11)
2. Region/Locale Format (e.g., China/Chinese)
Attachments
Test_43279.zip
(161.58 KiB) Downloaded 11 times
User avatar

Doris.Liu
 
Posts: 416
Joined: Mon Nov 07, 2022 8:10 am

Fri Nov 08, 2024 12:56 pm

The left side of the attached file is a picture created using the source you sent, and the right side is a file saved as a PDF from Excel.
If you look closely, the left and right margins, column spacing, etc. are subtly different, and
the text on the left side slightly covers the footnote below.

1. Operating System : Windows 11
2. Region/Locale Format : korea/korea
Attachments
제목 없음-2.png
제목 없음-2.png (100.75 KiB) Viewed 7 times

zorro012
 
Posts: 6
Joined: Mon Apr 25, 2022 12:20 pm

Mon Nov 11, 2024 10:00 am

Thank you for your explanation.

If you'd like to reduce the left and right margins, you can use the following code. I've noticed that the footer in the PDFs converted by our product does tend to be closer to the borders, but I haven't observed the difference in column spacing you mentioned. Could you please provide a screenshot to highlight it?

Code: Select all
wb.ConverterSetting.SheetFitToWidth = true;


Additionally, the results I obtained using Microsoft Excel seem to differ from yours in terms of left and right margins. I converted the file using Microsoft Excel into two different styles and have attached them for your reference.

Sincerely,
Doris
E-iceblue support team
Attachments
PDF_out.zip
(338.53 KiB) Downloaded 16 times
User avatar

Doris.Liu
 
Posts: 416
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.XLS