I am getting several types of exceptions in Words.Document.SaveToImage using the set of Word documents I have included in the zip file available here:
http://dl.getdropbox.com/u/289/word_exception_files.zip
I am calling SaveToImage as in this example:
Document doc = new Document(docPath);
for (int i = 0; i < doc.PageCount; i++)
{
FileStream fs = new FileStream(newFileName, FileMode.CreateNew);
doc.SaveToImage(i, 1, fs, ImageFormat.Png, null);
}
Here are the exceptions I’m getting:
Unknown border line style.
at ?.?.get_?()
at ?.?.?(Boolean ?)
at ?.?.?(? ?)
at ?.?.?(? ?, ? ?, Boolean ?, Boolean ?, ? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?, ? ?)
at ?.?.?(Int32 ?)
at ?.?.?(Int32 ?, Stream ?, ImageFormat ?)
at ?.?.?(Int32 ?, Int32 ?, Stream ?, ImageFormat ?, ImageOptions ?)
at Aspose.Words.Document.SaveToImage(Int32 pageIndex, Int32 pageCount, Stream stream, ImageFormat imageFormat, ImageOptions options)
Arithmetic operation resulted in an overflow.
at ?.?.?(PointF ?, PointF ?, Color ?, ? ?, Underline ?)
at ?.?.?(Single ?, ? ?)
at ?.?.?(? ?)
at ?.?.?(? ?, Boolean ?, ? ?)
at ?.?.?()
at ?.?.?()
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?, ? ?)
at ?.?.?(Int32 ?)
at ?.?.?(Int32 ?, Stream ?, ImageFormat ?)
at ?.?.?(Int32 ?, Int32 ?, Stream ?, ImageFormat ?, ImageOptions ?)
at Aspose.Words.Document.SaveToImage(Int32 pageIndex, Int32 pageCount, Stream stream, ImageFormat imageFormat, ImageOptions options)
The argument cannot be null or empty string.
Parameter name: value
at ?.?.?(String ?, String ?)
at Aspose.Words.Font.set_Name(String value)
at ?.?.get_?()
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?, ? ?)
at ?.?.?(Int32 ?)
at ?.?.?(Int32 ?, Stream ?, ImageFormat ?)
at ?.?.?(Int32 ?, Int32 ?, Stream ?, ImageFormat ?, ImageOptions ?)
at Aspose.Words.Document.SaveToImage(Int32 pageIndex, Int32 pageCount, Stream stream, ImageFormat imageFormat, ImageOptions options)
Buffer cannot be null.
Parameter name: buffer
at System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable)
at System.IO.MemoryStream..ctor(Byte[] buffer)
at ?.?.get_?()
at ?.?.get_?()
at ?.?.get_?()
at ?.?.?(? ?, Int32 ?)
at ?.?.?(? ?, Int32& ?)
at ?.?.?(Shape ?, Matrix ?, Single ?, Single ?, Single ?)
at ?.?.?(ShapeBase ?, Matrix ?, Single ?, Single ?, Single ?)
at ?.?.?(GroupShape ?, Matrix ?, Single ?, Single ?, Single ?)
at ?.?.?(ShapeBase ?, Matrix ?, Single ?, Single ?, Single ?)
at ?.?.?(GroupShape ?, Matrix ?, Single ?, Single ?, Single ?)
at ?.?.?(ShapeBase ?)
at ?.?.?(ShapeBase ?, ? ?, ? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?, ? ?)
at ?.?.?(Int32 ?)
at ?.?.?(Int32 ?, Stream ?, ImageFormat ?)
at ?.?.?(Int32 ?, Int32 ?, Stream ?, ImageFormat ?, ImageOptions ?)
at Aspose.Words.Document.SaveToImage(Int32 pageIndex, Int32 pageCount, Stream stream, ImageFormat imageFormat, ImageOptions options)
Object reference not set to an instance of an object.
at ?.?.?(Int32 ?)
at ?.?.?(? ?, Int32 ?)
at Aspose.Words.Font.?(Int32 ?)
at Aspose.Words.Font.?(Int32 ?)
at Aspose.Words.Font.get_Bold()
at ?.?.?(Paragraph ?, ? ?, ? ?)
at ?.?.?(Paragraph ?)
at ?.?.?(Node ?)
at ?.?.?()
at ?.?.¯()
at ?.?.MoveNext()
at ?.?.?()
at ?.?.?(Document ?, ? ?)
at Aspose.Words.Document.UpdatePageLayout()
at Aspose.Words.Document.get_?()
at Aspose.Words.Document.get_PageCount()