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.

Tue Mar 27, 2018 5:29 am

I am using Spire.Doc 6.3.5 to save a specific DOCX file as PDF and I get this error after a few seconds:

Object reference not set to an instance of an object


It's also not specific to PDF, happens if you save as other formats too so there is a problem reading the DOCX.
The sample DOCX file is attached.

dyoungx
 
Posts: 4
Joined: Tue Mar 27, 2018 5:11 am

Tue Mar 27, 2018 9:05 am

Hello,

Thanks for you post. I have reproduced your issue on a Win10 machine(the Win7 works fine). However, I have tested the PS Conversion which is another way for converting Word to PDF and it worked well. Please refer to the below code to use it.
Code: Select all
            Document document = new Document();
            document.LoadFromFile(@"Capital-Volume-I.docx", FileFormat.Docx);
            ToPdfParameterList ps = new ToPdfParameterList();
            ps.UsePSCoversion = true;
            document.SaveToFile("output.pdf", ps);


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Mar 27, 2018 9:29 am

Thanks for the reply. Yes I checked and UsePSCoversion works for Word to PDF. However the same error happens for other formats e.g. Word to XPS because you can't pass ToPdfParameterList for other formats. For debugging reference, the sample file has comments so maybe that's where DOCX parsing error happens?

By the way, are there any disadvantages to PS Conversion? Should it be always used for PDF conversion by default?

dyoungx
 
Posts: 4
Joined: Tue Mar 27, 2018 5:11 am

Tue Mar 27, 2018 9:56 am

Hello,

Thanks for your prompt reply. I have posted the issue to our DEV team for fixing. Once it's done, we will inform you. AS for the PS Conversion, it doesn't have any disadvantages, you could use it as a temporary workaround. It is commonly used in cloud servers when converting Word to PDF. And it is used for PDF conversion by default.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Apr 27, 2018 9:25 am

Hello,

Glad to inform you that the issue has been fixed. Welcome to download Spire.Doc Pack(hot fix) Version:6.4.11.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue May 01, 2018 7:29 am

Hello,

Greeting from E-iceblue.
How is the issue going? Has the hotfix resolved your issue?
Your feedback will be greatly appreciated.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Thu May 21, 2020 9:47 am

I have the same issue with the attached docx file with xml schema and content controls (repeater type not well supported).
Spire.Doc versions 7.11 free and 8.4.10. I'm trying it in order to purchase a PRO edition.
Would you be so kind to help me, please?

mizquierdot
 
Posts: 2
Joined: Tue May 19, 2020 10:54 am

Thu May 21, 2020 10:38 am

Hi Miguel,

Thanks for your inquiry.
I tried to convert your Word file to PDF, and indeed found the application threw the "NullReferenceException". This issue has been logged into our bug tracking system with the ticket SPIREDOC-4490. If there is any update, we will let you know.
Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

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

Fri Jun 05, 2020 11:03 am

Hi Miguel,

Thanks for your patient waiting.
Glad to tell you that we just released Spire.Doc Pack(hot fix) Version:8.6.3 which resolves the issue SPIREDOC-4490. Welcome to download it from the following links.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Doc/8.6.3

Sincerely,
Rachel
E-iceblue support team
User avatar

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

Mon Jun 08, 2020 10:04 am

Hi Rachel,
Everything works fine now!
Thank you very much.
Best regards,
Miguel

mizquierdot
 
Posts: 2
Joined: Tue May 19, 2020 10:54 am

Mon Jun 08, 2020 10:45 am

Hi Miguel,

Thanks for your feedback!
If you encounter any issue related to our product in the future, please feel free to contact us.
Wish you all the best :D !

Sincerely,
Rachel
E-iceblue support team
User avatar

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

Return to Spire.Doc