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.

Mon Apr 08, 2024 10:16 am

Hello,
I am trying to convert a Word-file (docx) to PDF using Spire.Doc but unfortunately this leads to an exception.

Used Spire.Doc version: 12.3.12

Code: Select all
ToPdfParameterList tpl = new ToPdfParameterList
{
    UsePSCoversion = false
};

using (MemoryStream wordStream = new MemoryStream(File.ReadAllBytes("Memo.docx")))
{
    Document document = new Document();
    document.LoadFromStream(wordStream, FileFormat.Docx);

    using (MemoryStream pdfStream = new MemoryStream())
    {
        document.SaveToStream(pdfStream, tpl);

        var converted = Convert.ToBase64String(pdfStream.ToArray());
    }
}


Exception:
Code: Select all
System.ArgumentNullException
  HResult=0x80004003
  Message=Value cannot be null.
Parameter name: trueTypeFont
  Source=Spire.Doc
  StackTrace:
   at spr쒵..ctor(Single A_0, FontStyle A_1, spr蘐 A_2, Boolean A_3, Boolean A_4, Boolean A_5)
   at spr㹝.ῑ(spr⼫ A_0, spr㞓 A_1, spr黚 A_2)
   at spr㣏.ῑ(spr㞓 A_0, spr몆 A_1, spr⼫ A_2)
   at spr㣏.Ἤ(spr㞓 A_0)
   at spr㥭.↫(ShapeBase A_0)
   at spr㥭.ῑ(ShapeBase A_0, spr㪩 A_1)
   at spr쵟.ῑ(ShapeBase A_0, spr홒 A_1)
   at spr쵟.ῑ(spr홒 A_0, Boolean A_1)
   at spr廬.ῑ(spr俍 A_0)
   at spr廬.(spr俍 A_0)
   at spr廬.ῑ(spr砙 A_0)
   at spr缲.谎()
   at spr伎.ῑ(spr炱 A_0)
   at spr伎.ῑ(spr䱇 A_0, ArrayList A_1, ArrayList A_2)
   at spr伎.ῑ(spr䱇 A_0, ArrayList A_1, ArrayList A_2)
   at spr伎.ῑ(spr䱇 A_0, ArrayList A_1, ArrayList A_2)
   at spr伎.ῑ()
   at spr嫩.쎻(spr惆 A_0)
   at spr㘏.ῑ(spr嫩 A_0)
   at spr㘏.ῑ(spr嫩 A_0, spr俍 A_1)
   at spr⋙.ῑ(sprꪨ A_0, spr㘏 A_1)
   at spr⋙.鯹(sprꪨ A_0)
   at Spire.Doc.Document.⅜(Stream A_0, ToPdfParameterList A_1)
   at Spire.Doc.Document.SaveToStream(Stream stream, ToPdfParameterList paramList)


The error occurs in a simple console application running under Windows Server 2016.

The Word-file which produces the error is attached.

Thanks in advance for any suggestions on how to overcome this issue.

supportProvaria
 
Posts: 5
Joined: Thu Aug 13, 2020 10:18 am

Tue Apr 09, 2024 2:42 am

Hi,

Thanks for your inquiry.
I tested your Word file and reproduced your issue, and I logged it into our bug tracking system with the ticket number SPIREDOC-10425, our Dev team will investigate and fix it. Once it is resolved, I will inform you 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

Fri Jun 28, 2024 1:33 am

Hi,

Thanks for your patience!
Glad to inform you that we just released spire.doc_12.6.10 which fixes the issue with SPIREDOC-10425.
Please download the new version from the following links to test.
Website download link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget download link: https://www.nuget.org/packages/Spire.Doc/12.6.10

Sincerely
Abel
E-iceblue support team
User avatar

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

Fri Jul 05, 2024 11:41 am

Hello and thanks a lot for the information and the new version of Spire.Doc.
We have updated to the currently latest version 12.7.3 and will test it thoroughly next week.

supportProvaria
 
Posts: 5
Joined: Thu Aug 13, 2020 10:18 am

Mon Jul 08, 2024 2:11 am

Hi,

Thanks for your feedback.
If you have any issues, just feel free to write back.

Sincerely
Abel
E-iceblue support team
User avatar

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

Tue Jul 09, 2024 4:47 pm

Hello,

we have done our tests now and I can definitely confirm, that conversion works now as expected.
Thanks a lot again for the update!

supportProvaria
 
Posts: 5
Joined: Thu Aug 13, 2020 10:18 am

Wed Jul 10, 2024 7:47 am

Hi,

Thanks for your feedback.


Sincerely
Abel
E-iceblue support team
User avatar

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

Return to Spire.Doc