Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Jan 01, 2021 12:17 am

Hi!
I have a .net core 3.1 project and I'm trying to create a pdf file from a Document object on ubuntu 20.04 amd64 and I get this:

Code: Select all
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at sprᰋ.ᜁ(TextRange A_0, spr᭲ A_1, RectangleF& A_2, Boolean A_3, spr៧ A_4)
   at sprᰋ.ᜀ(TextRange A_0, IDocumentObject A_1, Paragraph A_2, String A_3, Boolean A_4)
   at sprឦ.ᜀ(RectangleF A_0)
   at sprឣ.ᜋ(sprអ A_0)
   at sprឣ.ᜁ(RectangleF A_0)
   at sprឤ.ᜂ(sprអ A_0)
   at sprឣ.ᜁ(RectangleF A_0)
   at sprឣ.ᜋ(sprអ A_0)
   at sprឣ.ᜁ(RectangleF A_0)
   at sprព.ᜀ(sprឌ A_0, sprឆ A_1, sprᰋ A_2)
   at sprᰃ.ᜋ()
   at sprᰃ.ᜒ()
   at sprᰃ.ᜓ()
   at sprᰃ.ᜀ(IDocument A_0)
   at spr᱔.ᜀ(Document A_0, Stream A_1, ToPdfParameterList A_2)
   at Spire.Doc.Document.ᜀ(String A_0, ToPdfParameterList A_1)
   at Spire.Doc.Document.ᜅ(String A_0)
   at SpireTest.Report.CreateChapter2(String resourcePath, String outputPath) in /root/res/SpireTest/SpireTest/Report.cs:line 42
   at SpireTest.Program.Main(String[] args) in /root/res/SpireTest/SpireTest/Program.cs:line 10


I tested this project on my windows 10 pc and it worked just fine! I have also installed libgdiplus package and I have no idea why it is happening. please help me!
I attached my code to the attachment.

M.Mahdi.Sonic
 
Posts: 2
Joined: Thu Dec 31, 2020 11:46 pm

Fri Jan 01, 2021 9:53 am

Hello,

Thanks for your inquiry.
To help us investigate your issue more accurately and quickly, please provide us with your input files. You could send them to us(support@e-icelue.com) via email. Thanks in advance.

Besides, please confirm whether all fonts used in your Word file have been installed on your system. If not, I suggest you install the corresponding fonts and try again.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Jan 01, 2021 12:51 pm

Hi again,

Thanks for your quick response.
I simplified the project as much as I could in order to avoid any distractions like fonts and other things, however, it still runs without any problem on windows 10 but not on Ubuntu.
The Word file is totally empty and I tried to attach just one picture to it. I use "dotnet run" in CLI when I'm in DocTest directory for running the project. The Exceptions are just like the previous post
I really need it to work!

M.Mahdi.Sonic
 
Posts: 2
Joined: Thu Dec 31, 2020 11:46 pm

Mon Jan 04, 2021 7:46 am

Hello,

Thanks for your more details and sorry for the late reply as weekend.
I tested your scenario and did reproduce your issue. I have logged it in our bug tracking system with the ticket SPIREDOC-5410. If there is any update, we will let you know. Apologize for the inconvenience caused.
If you have any other questions, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Oct 05, 2022 9:45 am

I'm encountering similar problem with .NET 6 (Docker with mcr.microsoft.com/dotnet/aspnet:6.0 as base image) and SpireDoc 8.12.14 . Do you have any update on this (SPIREDOC-5410)?

jkstream
 
Posts: 3
Joined: Wed Oct 05, 2022 9:36 am

Wed Oct 05, 2022 10:13 am

jkstream wrote:I'm encountering similar problem with .NET 6 (Docker with mcr.microsoft.com/dotnet/aspnet:6.0 as base image) and SpireDoc 8.12.14 . Do you have any update on this (SPIREDOC-5410)?


Hi,

Thanks for your inquiry.
SPIREDOC-5410 issue in M.Mahdi.Sonic's document has not been solved yet.
For your case, did you install spire dlls for .net standard? If not, please install them via NuGet link https://www.nuget.org/packages/Spire.Officefor.NETStandard/7.9.2 and try again.
If it doesn't work, please offer the following information.
1. Your word file.
2. Your full code.
3. Your OS information, for example, ubuntu 20.04 amd64.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Wed Oct 05, 2022 11:26 am

After adding mentioned library, I get new exception, which is good: Unable to load shared library 'libSkiaSharp'

Quick Google advised to install in Docker image libfontconfig1 and add SkiaSharp.NativeAssets.Linux nuget. Right now, it processes the file - not sure yet how it looks after opening (just tested a piece of system). A side effect is Spire.License.LicenseProvider.SetLicenseKey invocation - it started saying that it exists in 2 libraries (Spire.License and Spire.PDF)

jkstream
 
Posts: 3
Joined: Wed Oct 05, 2022 9:36 am

Wed Oct 05, 2022 2:10 pm

I removed previous version of Spire.Doc (8.12.14) and license is not raising an error right now, I'm getting a PDF file with warning

Evaluation Warning: The document was created with Spire.Doc for .NET


I applied the license key which is working with mentioned verion, however it does not work with Spire.Officefor.NETStandard. Is there any other possible solution for this problem which would accept current license key?

jkstream
 
Posts: 3
Joined: Wed Oct 05, 2022 9:36 am

Thu Oct 06, 2022 5:33 am

Thank you for your feedback.
I'm sorry that I didn't find your purchase information according to your email, could you please provide your order information or authorization email? You could attach the required information here or send to us via email (support@e-iceblue.com). According to the version of Spire.Doc you provided, this version (8.12.14) is relatively old. The minimum version of Spire.Officefor.NETStandard is 6.12.1. Please try this version first. Looking forward to your test feedback.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.Doc