Free Support Forum -

Aspose.Words - "Unable to read beyond the end of the stream."

I have the following code :

For index = 0 To alHTML.Count - 1
Dim chart As ChartObject = New ChartObject()

chart = CType(alHTML(index), ChartObject)

If chart.type = "HTML" Then
End If
If chart.type = "Chart" Then
End If
builder.Document.Save("c:\temp\" + "Out.doc")

I get the error when I try to insertImage.

The image is an URL to the image.



There might be a problem with dowloading the image or with the image itself. If the URL is publicly accessible on the web, let me know, I will try to reproduce downloading. If not, just attach the image file here, I will try with it.

That URL's of the Image that in this ArrayList are :



Thanks. I've reproduced this. The problem seems to be related to extra garbage 4 bytes at the end of the PNG file. I've fixed Aspose.Words to handle such image successfully anyway. When a new release is made in the next few days, you will be notified.

Thanks for the quick response.


We have released a new version of Aspose.Words that contains a fix for your issue.

issue #4239 - Cannot insert PNG image, error Unable to read beyond the end of the stream.

The new version of Aspose.Words is available for download from here.

Best regards.

Thank you very much. It seems to be working great now.