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.

Thu Jan 28, 2021 10:00 am

Hello,

When i try to convert the docx ( present in attachment) to PDF, i have the following error :

2021-01-27 16:03:55.199 +01:00 [INF] Erreur pour Lettre de motivation.docx : System.NullReferenceException: Object reference not set to an instance of an object.
at spr⠜.ᜀ(Paragraph A_0, spr⎣ A_1)
at spr⠜.ᜃ(Paragraph A_0, spr⎣ A_1)
at Spire.Doc.Documents.Paragraph.Spire.Doc.Layout.IDocumentBase.Draw(spr⠜ dc, spr⎣ ltWidget)
at spr⎣.ᜂ(spr⠜ A_0)
at spr⎣.ᜂ(spr⠜ A_0)
at spr⎣.ᜂ(spr⠜ A_0)
at spr⠬.ᜃ(spr⠜ A_0)
at spr⠔.ᜀ(Int32 A_0, Int32 A_1)
at spr⡥.ᜀ(spr⠔ A_0, Stream A_1)
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 XX.XX.XX.ConverterFileManager.ConvertDocxToPdf(String docxFile) in C:\XX\XX\XX\XX.XX\XX\ConverterFileManager.cs:line 28
at XX.XX.XX(Fichier fichier) in C:\XX\XX\XX\XX.XX\Program.cs:line 348
at XX.XX.XX(Candidature candidature) in C:\XX\XX\XX\XX.XX\Program.cs:line 298

We use Spire.Office with the 6.1.0 version.
The methode use come from the class Spire.Doc.
The methode use is "document.SaveToFile(result, FileFormat.PDF);" where document is a Document from namespace Spire.Doc.

Thanks in advance for your future answer.

FlorianHoltzinger
 
Posts: 4
Joined: Thu Jan 28, 2021 9:48 am

Fri Jan 29, 2021 6:38 am

Hello,

Thanks for your inquiry.
I tested the following code with the Spire.Office 6.1.0 but didn't reproduce your issue. To help us investigate further, please provide us with your OS information (e.g. Win7 64bit), your region setting (e.g. China, Chinese) and the project target framework version (e.g. .NET Framework 4.5). Thanks in advance.
Code: Select all
            Document doc = new Document();
            doc.LoadFromFile("Lettre de motivation.docx");
            doc.SaveToFile("resultOffice6.1.0.pdf", FileFormat.PDF);


Sincerely,
Brian
E-iceblue support team
User avatar

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

Fri Jan 29, 2021 1:14 pm

Hi again,

We use a Windows Server 2016 Standard. Our current region setting is United States.
The target framework is .Net Core 2.1.
For developpement, we use a Visual Studio Professional 2017.

The code you gave us, is the current code inside our application.

Thanks in advance for your future answer.

FlorianHoltzinger
 
Posts: 4
Joined: Thu Jan 28, 2021 9:48 am

Mon Feb 01, 2021 8:44 am

Hello,

Thanks for providing more information.
I tested your case in a similar environment to yours, but still did not reproduce your issue. I have attached my test project, please run it directly on your side and then let us know your test results. Looking forward to your further response.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Tue Feb 02, 2021 1:26 pm

Hello,

I have reproduce the same issue with your project.
I just made some changes.
You will find it attached.

Thanks in advance for your future answer,
Florian

FlorianHoltzinger
 
Posts: 4
Joined: Thu Jan 28, 2021 9:48 am

Wed Feb 03, 2021 7:48 am

Hello Florian,

Thanks for your feedback.
Sorry I didn’t see the attachment you mentioned, could you please attach it again? Besides, kindly note that our forum has a size limit for attachments. You could upload the modified project to the DropBox or OneDrive and then share the download link with us.
Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Wed Feb 03, 2021 8:50 am

Hello Brian,

Oops, i think i forgot to add it.
You will find it attached.
Sorry for the delay.

Sincerely,
Florian

FlorianHoltzinger
 
Posts: 4
Joined: Thu Jan 28, 2021 9:48 am

Wed Feb 03, 2021 10:18 am

Hello Florian,

Thanks for your prompt response.
When testing the modified project, I did reproduce your issue. I have logged it in our bug tracking system with the ticket SPIREDOC-5523. 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

Mon Mar 15, 2021 9:55 am

Hello Florian,

Thanks for your patient waiting.
SPIREDOC-5523 has been solved. Please download and test Spire.Office Platinum(Hotfix) Version:6.3.3.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Office/6.3.3

Sincerely,
Amy
E-iceblue support team
User avatar

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

Fri Mar 26, 2021 7:14 am

Hello Florian,

Greetings from E-iceblue.
Does this hotfix solve you issue? Could you please give us some feedback at your convenience?


Sincerely,
Brian
E-iceblue support team
User avatar

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

Return to Spire.Doc