- Code: Select all
Unhandled Exception: System.ArgumentException: Argument_AddingDuplicate__, /home/eric/documents/demonstration/calefy-backend/insurtech_backend/core/tmp/fonts-29bac59f-b766-4d14-b244-c858d55a80fe - en/Roboto/Roboto-Light.ttf, /home/eric/documents/demonstration/calefy-backend/insurtech_backend/core/tmp/fonts-29bac59f-b766-4d14-b244-c858d55a80fe - en/Roboto/Roboto-Light.ttf
at System.Collections.Hashtable.Insert(Object, Object, Boolean) + 0x38b
at spropj.spra() + 0x1dd
at Spire.Xls.Workbook.set_CustomFontFileDirectory(String[]) + 0xeb
at Spire.Xls.AOT.NLWorkbook.Workbook_set_CustomFontFileDirectory(IntPtr, IntPtr, Int32) + 0x5c
As you can see, we've even tried to create a custom font folder (in this case, fonts-29bac59f-b766-4d14-b244-c858d55a80fe - en) for each generated document, but that doesn't appear to solve the issue. We set the font in
- Code: Select all
external_quote_proposal = Workbook()external_quote_proposal.LoadFromFile(str(english_external_destination_path))
external_quote_proposal.CustomFontFileDirectory = [str(this_run_font_file_directory_en)]
The above error is the one that we encounter when this is run on Ubuntu 22.04.1. Interestingly, we get a different error when run on a Docker container based off of the Python 3.9 image at https://hub.docker.com/_/python. In that case, we get the following error (which presumably is related):
- Code: Select all
Unhandled Exception: System.InvalidCastException: Arg_InvalidCastException
at System.Runtime.TypeCast.CheckCastClass(MethodTable*, Object) + 0x2b
at SkiaSharp.SKAbstractManagedStream.ReadInternal(IntPtr s, Void* context, Void* buffer, IntPtr size) + 0xcc
at Spire.Xls.Base!<BaseAddress>+0x1fe1150
We had a similar issue earlier which was tracked as SPIREDOC-10645.
I'm working on an MWE, but do you have any ideas why this is occurring or what I can do to avoid it?