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

Hi,

We're using Aspose.Pdf 2.9.2.0 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);
sec1.Paragraphs.Add(image1);
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);

Hi,

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 3.6.2.0 Hot Fix (full installer) ??? Thanks.

Hi,

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