When attempting to preview a Word document as an image using Aspose, we get an error when the document contains Japanese text.
The error is “An unhandled exception of type ‘System.StackOverflowException’ occurred in mscorlib.dll”
It appears to cause IIS to crash with DoctorWatson errors…
File that can cause this issue is attached.
Code example below:
Dim bmp As Bitmap
AsposeCommon.LoadLicence(True)
Using blobStream As New System.IO.MemoryStream(BLOBData)
Dim wordDoc As New Aspose.Words.Document(blobStream)
Dim view As New Aspose.Words.Viewer.DocumentRenderer(wordDoc)
Using memStream As New MemoryStream
bmp = view.GetPage(1) 'first page
If Deliver Then
bmp.Save(memStream, System.Drawing.Imaging.ImageFormat.Png)
Response.Clear()
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "image/png"
memStream.WriteTo(Response.OutputStream)
Response.End()
End If
End Using
End Using
Return bmp