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 Apr 04, 2024 10:22 pm

I am using spire python 0.4.2

My use case is very simple, I have tried 2 xlsx files both with 1 word in cell A1 "hello". I first tried the default calibri font, then switched to
DejaVu sans.

I am running on a Debian container AND the fonts are present - see below:
Code: Select all
root@bbda758b9700:/usr/share/fonts/truetype# fc-list
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/calibri/calibri.ttf: Calibri:style=Regular
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/local/share/fonts/calibri.ttf: Calibri:style=Regular
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book


But I get the following error:
Code: Select all
 File "/usr/local/lib/python3.11/site-packages/plum/function.py", line 592, in __call__
    return _convert(method(*args, **kw_args), return_type)
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/spire/xls/Workbook.py", line 941, in SaveToFile
    CallCFunction(GetDllLibXls().Workbook_SaveToFileF, self.Ptr, fileName,enumfileFormat)
  File "/usr/local/lib/python3.11/site-packages/spire/xls/common/__init__.py", line 109, in CallCFunction
    raise SpireException(info)
spire.xls.common.SpireException: Cannot found font installed on the system.:   at sprsu5.spra(Stream) + 0x81
   at Spire.Xls.Core.Spreadsheet.XlsWorkbook.SaveToPdf(String) + 0x16b
   at Spire.Xls.AOT.NLWorkbook.Workbook_SaveToFile(IntPtr, IntPtr, Int32, IntPtr) + 0x71

What else can I try? (I did try the set customfilefontpath call on workbook - that does not seem to work either - unless I am using it incorrectly)

Any help greatly appreciated.

cweiss_1
 
Posts: 9
Joined: Thu Apr 04, 2024 8:55 pm

Fri Apr 05, 2024 8:55 am

Hi,

Thanks for your inquiry.
Have you already installed the font (DejaVu sans) in docker container? If not, please install and make sure that the font can be accessed by current user, then test your scenario again. If the issue still exists, please offer your code and input excel file to help us do further investigation, you can send them via email(support@e-iceblue.com) or attach them here. Thanks in advance.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Wed Apr 24, 2024 3:09 pm

@Abel -
1) has DejaVu Sans font been installed in the container?
- yes. As I have shown in the snippet in my original post. The directory listing is from within the container
- user should have access (am runing as root)

2) I attached my test file.

Please let me know if there is anything I can do to provide more info.
Thanks
Attachments
simpletest.zip
(7.71 KiB) Downloaded 364 times

cweiss_1
 
Posts: 9
Joined: Thu Apr 04, 2024 8:55 pm

Thu Apr 25, 2024 9:53 am

Hi,

Thanks for your feedback.
Now, I’m trying to create debian container to test your scenario, but this process will take some time. However, once there are any updates, I’ll give you feedback. In addition, could you share your Dockerfile and test *.py file to help us do accurately investigation? Thanks in advance.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Thu Apr 25, 2024 9:54 pm

let me create a simpler example and post the docker and py file. But, I assume from your responses that this is expected to work?

cweiss_1
 
Posts: 9
Joined: Thu Apr 04, 2024 8:55 pm

Fri Apr 26, 2024 1:21 am

attached is the Dockerfile, test.py and test.xlsx

run using docker run -it <container>
or
docker run -it <container> bash
and then cd /testuser; python test.py
Attachments
spiretest.zip
(1.42 MiB) Downloaded 354 times

cweiss_1
 
Posts: 9
Joined: Thu Apr 04, 2024 8:55 pm

Fri Apr 26, 2024 10:08 am

Hi,

Thanks for your feedback.
I’m testing your scenario, I’ll give feedback in time. Sorry for the inconvenience caused.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Sun Apr 28, 2024 6:50 am

Hi,

Thanks for your patiently waiting.
I reproduced your issue and logged it into our bug track system with the ticket number SPIREXLS-5229. Our Dev team will investigate and fix it. Once it is resolved. I’ll inform you in time.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Tue Apr 30, 2024 5:40 pm

Thanks Abel. Will wait for your reply (if there is a workaround in the meantime, I am open to doing that in the container as well)

cweiss_1
 
Posts: 9
Joined: Thu Apr 04, 2024 8:55 pm

Wed May 01, 2024 1:53 am

Hello,

Our Dev team are further confirming the cause of this issue. Once there is further progress, we will provide feedback to you as soon as possible. Thank you for your patience.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1269
Joined: Wed Apr 25, 2018 3:20 am

Wed May 08, 2024 12:56 am

Thanks ... eagerly awaiting the fix! :-)

cweiss_1
 
Posts: 9
Joined: Thu Apr 04, 2024 8:55 pm

Mon May 20, 2024 8:15 pm

@Abel - any luck here?

cweiss_1
 
Posts: 9
Joined: Thu Apr 04, 2024 8:55 pm

Tue May 21, 2024 1:55 am

Hi,

Thanks for your following-up.
The issue currently isn't resolved due to it's complexity. However, I have urged our Dev team to speed up fixing it. Sorry for the inconvenience caused.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Wed Jun 05, 2024 2:16 pm

@Abel - any progress?

Also, is there any workaround at all that I can do from my side to get this to work?

cweiss_1
 
Posts: 9
Joined: Thu Apr 04, 2024 8:55 pm

Thu Jun 06, 2024 10:14 am

Hi,

Thanks for your following-up.
Sorry for the issue currently is not resolved.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.XLS