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.

Thu Nov 23, 2023 2:15 pm

When i convert a sheet from EXCEL to PDF it squeezes the content in the pdf and then crops out some content, i thought it was an issue with the excel file itself but when i manually try to print the page it looks normal

Version: Spire.Xls==13.9.0

Environment Windows 11

Application Type: FastAPI
Attachments
Output.zip
The Output i get
(172.92 KiB) Downloaded 412 times
Expected Output.zip
The Output i expect
(683.28 KiB) Downloaded 442 times
Input.zip
i want to convert the second sheet
(253.87 KiB) Downloaded 391 times

dstomps96
 
Posts: 10
Joined: Mon Oct 30, 2023 4:30 pm

Thu Nov 23, 2023 2:17 pm

This is my code


workbook = Workbook()

# Load the excek document
workbook.LoadFromFile(sheet_path)

# Get a particular worksheet
sheet: Worksheet = workbook.Worksheets[1]

# # Get the PageSetup object
pageSetup: PageSetup = sheet.PageSetup
pageSetup.PaperSize = PaperSizeType.PaperLetter

# # Set page margins
pageSetup.TopMargin = 0.1
pageSetup.BottomMargin = 0.1
pageSetup.LeftMargin = 0.1
pageSetup.RightMargin = 0.1
pageSetup.AlignWithMargins = True

# Set worksheet to fit to page when converting
workbook.ConverterSetting.SheetFitToPage = True

# Convert the worksheet to PDF file
sheet.SaveToPdf(pdf_file_path)
workbook.Dispose()

dstomps96
 
Posts: 10
Joined: Mon Oct 30, 2023 4:30 pm

Fri Nov 24, 2023 6:00 am

Hi,

Thank you for your inquiry.
I have tested the excel file and code you provided and reproduced your issue. I have recorded this issue in our bug tracking system with the number "SPIREXLS-5003". Our development team will investigate and fix it in the future. If this issue is resolved, we will notify you as soon as possible. We deeply apologize for the inconvenience caused.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Thu Nov 30, 2023 10:15 am

Good day to you, when can i expect the bug to be resolved

dstomps96
 
Posts: 10
Joined: Mon Oct 30, 2023 4:30 pm

Fri Dec 01, 2023 3:10 am

Hi,

Thank you for your feedback.
Don’t worry, I have urged our Dev team to speed up fixing your issue, if there are any updates, I will inform you in time. We will do our best to help you.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Wed Dec 06, 2023 8:06 am

Any update?

dstomps96
 
Posts: 10
Joined: Mon Oct 30, 2023 4:30 pm

Wed Dec 06, 2023 9:20 am

Hi,

Thank you for your feedback.
I have once again urged our Dev team and raised the priority of your issue. If there is any progress, I will inform you immediately. Please give us some time, we will do our best to help you.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Fri Dec 08, 2023 7:21 am

Hi,

Thank you for your patience.
After investigation by our Dev team, it is likely that your issue is caused by the display settings of the system. Please set the advanced zoom setting of the system display to 100% as shown in the screenshot below, and then download our latest version Spire.Xls for .Net 13.11.4 for testing again. If you have any issue, just feel free to contact us.
F241E918-2D7E-4338-B927-89796D067FCB.png
F241E918-2D7E-4338-B927-89796D067FCB.png (26.5 KiB) Viewed 3850 times


Website download link: https://www.e-iceblue.com/Download/download-excel-for-net-now.html

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Fri Dec 08, 2023 9:31 pm

Hello,

I changed to 100% and it didnt do anything,

Please take note i am using spire.xls for python and that i am using the code live in production on a server

dstomps96
 
Posts: 10
Joined: Mon Oct 30, 2023 4:30 pm

Mon Dec 11, 2023 7:14 am

Hi,

Thank you for your feedback.
I tested your code with the latest version of Spire.Xls for Python 13.11.1 and also reproduced your issue. My system environment is Win10. In your first response, you mentioned that the system environment is Win11, but in the latest feedback, it was mentioned that your code live on the server. May I ask what is your server? Such as Centos 7.6 or Win Server2008, etc.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Tue Dec 12, 2023 11:59 am

I apologize for any confusion. During my development, I use Windows 11 as my operating system, and that's where I wrote the code. I test the code on this environment. When I push the code live, I face the same issue. I'm using an Infrastructure as a Service (IaaS) called railway.app for deployment, but I'm not certain about the specific server type they use. PS I deploy as a docker image

To provide more context, I assumed that if I fix the issue locally on my Windows 11 environment, it should also resolve the problem when I push the code live to the server.

But you saying to increase the scale to 100% even if i fixed the issue locally on my windows 11 i am not sure how i can reproduce that fix in production
Last edited by dstomps96 on Wed Dec 13, 2023 9:01 am, edited 1 time in total.

dstomps96
 
Posts: 10
Joined: Mon Oct 30, 2023 4:30 pm

Wed Dec 13, 2023 8:29 am

Hi,

Thank you for your feedback.
I have truthfully reported your scenario to our R&D team and urged them to speed up fixing your issue, please be patient and wait. If this issue is resolved, we will notify you as soon as possible. We deeply apologize for the inconvenience caused.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Wed Dec 13, 2023 9:03 am

Thank you very much and i apologize for any issues i caused, i forgot to add yesterday that i deploy it as a docker image

here is my dockerfile

FROM python:3.11

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /app

COPY . /app

RUN pip install -r requirements.txt

EXPOSE 8000

ARG DATABASE_URL
RUN echo $DATABASE_URL

CMD [ "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

dstomps96
 
Posts: 10
Joined: Mon Oct 30, 2023 4:30 pm

Wed Dec 13, 2023 9:56 am

Hi,

Thank you for your feedback.
I have truthfully reported your scenario to our R&D team , please be patient and wait. If this issue is resolved, we will notify you as soon as possible. We deeply apologize for the inconvenience caused.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Thu Dec 21, 2023 9:55 am

Hello,

Any updates regarding this?

dstomps96
 
Posts: 10
Joined: Mon Oct 30, 2023 4:30 pm

Return to Spire.XLS