We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Exception "Unable to read beyond the end of the stream"on saving EMF file(C#)

For some, not all, EMF files I get following error when trying to save the image to disk:

EndOfStreamException “Unable to read beyond the end of the stream”

Here is code that recreates it and I have attached the sample EMF file.

File.zip (460 Bytes)

        var inputFile = @"d:\input\1.emf";
            var image = Image.Load(inputFile);
        }catch(Exception ex)
            // throws a unable to read past stream exception




I have worked with the source files shared by you and have been able to observe the issue shared. An issue with ID IMAGINGNET-3356 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

The issues you have found earlier (filed as IMAGINGNET-3356) have been fixed in this update.