Free Support Forum - aspose.com

DOC to PDF: System.NullReferenceException

Version of Aspose.Words 21.4.
Load document with Aspose and save it to PDF format.

: System.NullReferenceException: Object reference not set to an instance of an object.
   at    . (    , Int32 ,     , Int32, Int32 )
   at    .(    )
   at    (    )
   at    . (    )
   at    .(    , Int32 )
   at   (    )
   at    . (    )
   at    .(    , Int32 , Boolean )
   at    (    , Int32 , Boolean )
   at    .(    , Int32 , Boolean )
   at    .(    , Int32 , Boolean )
   at    . ()
   at    . (    , Int32 , Boolean , Boolean)
   at    . (    , Int32 , Boolean , Boolean)
   at    ()
   at   . (    , Int32 )
   at   . (    , Int32 )
   at    . (    )
   at    . ()
   at    . (    )
   at   .(    )
   at ​  . (    )
   at    . (    )
   at     ()
   at    .()
   at Aspose.Words.Document.UpdatePageLayout()
   at       ,     )
   at            )
   at    .         )
   at Aspose.Words.Document      )
   at Aspose.Words.Document.​(Stream , String , SaveOptions )
   at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)

Another example

Another example 2

@boris.nikitin,

To address these problems, we have logged WORDSNET-22357 (related to 182_1602167701.doc) and WORDSNET-22358 (related to 1-000_grundkonzept-sicherheit-2010-08-22.doc) in our issue tracking system.

I am afraid, we are unable to download this file; can you please ZIP and reattach it here for testing?

71cf00f4ec.docx.zip (4.6 MB)
from here

@boris.nikitin,

After an initial test with the licensed latest (21.6) version of Aspose.Words for .NET, we were unable to reproduce this exception on our end. We used the following simple code snippet on our end for testing (see output PDF 21.6.pdf (4.2 MB)):

Document doc = new Document("C:\\Temp\\71cf00f4ec.docx");
doc.Save("C:\\Temp\\21.6.pdf");

So, we suggest you to please upgrade to the latest (21.6) version of Aspose.Words for .NET.