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

Free Support Forum - aspose.com

ImageFileType.Png PNG file from Url will not load


We're using Aspose.Pdf and when using ImageFileType.Png on an external PNG image, the PNG image does not load. We get an error: "[NotSupportedException: This stream does not support seek operations.] System.Net.ConnectStream.get_Length()". However, simply changing the ImageFileType.Png to ImageFileType.Bmp works- why? Here is sample C# code:

Pdf pdf1 = new Pdf();
Section sec1 = pdf1.Sections.Add();
Aspose.Pdf.Image image1 = new Aspose.Pdf.Image(sec1);
image1.ImageInfo.File = "http://www.google.com/images/nav_logo3.png";

image1.ImageInfo.ImageFileType = ImageFileType.Png;

image1.ImageInfo.Title = "PNG image";
pdf1.Save("test.pdf", SaveType.OpenInBrowser, Response);


Thank you for considering Aspose.

The problem has been resolved. Please update to the latest version.

Thanks for your quick reply.

Which version of Aspose.Pdf was this fixed in?

And is the latest version = Aspose.Pdf for .Net Hot Fix (full installer) ??? Thanks.


Yes currently is the latest official version. Sorry I am not sure which version of Aspose.Pdf was this bug fixed in.