I’m experiencing the following exception when attempting to save a Word document using Aspose.Words (3.5.0.0):
Value was either too large or too small for an Int16.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.OverflowException: Value was either too large or too small for an Int16.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
---|
Stack Trace:
[OverflowException: Value was either too large or too small for an Int16.]
System.Convert.ToInt16(Int32 value) +69
୰.ட.ஶ(Byte[] ஷ, Int32 ஸ, Int32 ஹ, Int32 , Int32 )
୰.ட.get_୪()
୰.ᖊ.ᖙ(୯ ᒶ)
៥.ᤁ.ᤓ(୯ ᒶ, Double ᖐ, Double ᖑ, Boolean ᤐ)
៥.ᤁ.ᤑ(InlineShape ᣴ, Boolean ᤐ)
៥.ᤁ.ᤏ(InlineShape ᣴ, Boolean ᤐ)
ᣢ.ᣡ.VisitInlineShape(InlineShape shape)
Aspose.Words.InlineShape.Accept(DocumentVisitor visitor)
Aspose.Words.CompositeNode.ാ(DocumentVisitor ଯ)
Aspose.Words.Paragraph.Accept(DocumentVisitor visitor)
Aspose.Words.CompositeNode.ാ(DocumentVisitor ଯ)
Aspose.Words.Body.Accept(DocumentVisitor visitor)
ᣢ.ᣡ.ᢖ(Section ᗻ)
ᣢ.ᣡ.ᣪ(Document ᗙ, Stream Ը, String ߫)
Aspose.Words.Document.ധ(Stream Ը, String ߫, SaveFormat ന)
Aspose.Words.Document.Save(String fileName, SaveFormat fileFormat)
CMIS.Http.BinaryResourceHandler.ProcessOfficeDocumentRequest(DocumentStream theDoc, HttpContext context) in c:\documents and settings\steve\my documents\development components\enline\httphandlers\binaryresourcehandler.cs:274
CMIS.Http.BinaryResourceHandler.ProcessDocumentRequest(Int32 id, HttpContext context, Boolean doConvert) in c:\documents and settings\steve\my documents\development components\enline\httphandlers\binaryresourcehandler.cs:173
CMIS.Http.BinaryResourceHandler.ProcessDocumentRequest(Int32 id, HttpContext context) in c:\documents and settings\steve\my documents\development components\enline\httphandlers\binaryresourcehandler.cs:128
CMIS.Http.BinaryResourceHandler.ProcessRequest(HttpContext context) in c:\documents and settings\steve\my documents\development components\enline\httphandlers\binaryresourcehandler.cs:720
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
The relevant code looks like this:
Aspose.Words.License wlic = new Aspose.Words.License();
wlic.SetLicense(@Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Aspose.Total.lic"));
Aspose.Words.Document wDoc = new Aspose.Words.Document(sourceFile.FullName);
wDoc.Save(xmlFile.FullName, SaveFormat.FormatAsposePdf); // EXCEPTION THROWN HERE
A sample “problem” document is attached.
- Steve Ford