Free Support Forum - aspose.com

DOCX TO PDF: ArgumentOutOfRangeException

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

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at    . (Int32 , PointF , PointF )
   at    . (Int32 , PointF , PointF )
   at    .      ()
   at    .     ()
   at    . (    )
   at    . ()
   at     ()
   at    . ()
   at    . (ShapeBase ,     )
   at  ​  ​   ( ​  )
   at  ​ .(ShapeBase )
   at  ​ .(ShapeBase ,  ​  )
   at ​  .(ShapeBase ,     )
   at ​  .(    , Boolean )
   at    .(    )
   at    (    )
   at    .(    )
   at         ()
   at   .()
   at         ()
   at    .       ()
   at    .      ()
   at    . (Int32 )
   at    . (Boolean , Int32 )
   at    . (Boolean )
   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    . (Node ,     )
   at    . (Node )
   at Aspose.Words.Document. ()
   at Aspose.Words.Document      )
   at Aspose.Words.Document.​(Stream , String , SaveOptions )
   at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)

@boris.nikitin,

While using the latest (21.6) version of Aspose.Words for .NET, we have also managed to reproduce the following exception on our end upon converting your Word DOCX to PDF.

System.ArgumentOutOfRangeException
  HResult=0x80131502
  Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  Source=mscorlib
  StackTrace:
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)

We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-22354. Your thread has also been linked to this issue and you will be notified here as soon as it will get resolved in future. Sorry for the inconvenience.