Generic GDI+ Exception

Hello,
I need to convert a PNG file into a PDF.
Usually I use this code :
Dim pdfDocument As New Document()
pdfDocument.Pages.Add()
Dim Image As Aspose.Pdf.Image = New Aspose.Pdf.Image()
Image.File = file
Dim MarginInfo As MarginInfo = New MarginInfo()
MarginInfo.Top = 0
MarginInfo.Left = 0
MarginInfo.Right = 0
MarginInfo.Bottom = 0
pdfDocument.Pages(1).PageInfo.Margin = MarginInfo
pdfDocument.Pages(1).Paragraphs.Add(Image)
Dim TmpPath As String = _path_e_PPPPMMMM & “.pdf”
pdfDocument.Save(_TmpPath)

But now, for the file I posted as attachment, I receive the following exception:

System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(Stream stream, ImageFormat format)
at Aspose.Pdf.XImageCollection.#=zeDqKJl2JkLTn_x4I$g==(Stream #=zSTPS3Fc=, #=zmQ2IzQQuwJuzpkkhGQkD9jXhEMRZWAgVWxnszLi$Sw_I #=zK1vHsZM=, #=zKcUUx2bOnR$Fl9_7Qli354fG3Ti0bAsZZQ== #=znc9i8zk=, Int32 #=zgZgb6V8=, Image& #=zG9Ic9ReybXD, Stream #=zbJ4sSmYuRcGQCHbbQIj2rOE=)
at Aspose.Pdf.XImageCollection.#=zoWQ0I9xMPfuj(Int32 #=z8XmTY4o=, Stream #=zSTPS3Fc=, Int32 #=zgZgb6V8=, Boolean #=z3NM8PT7_YXDC, ImageFilterType #=znildsQc=, Byte #=zcRTyRkOEuA3B, Boolean #=zJg0qn1c=, String& #=zgey9oFmrwtfR, Stream #=zbJ4sSmYuRcGQCHbbQIj2rOE=)
at Aspose.Pdf.XImageCollection.#=zoWQ0I9xMPfuj(Int32 #=z8XmTY4o=, Stream #=zSTPS3Fc=, Int32 #=zgZgb6V8=, Boolean #=z3NM8PT7_YXDC, ImageFilterType #=znildsQc=, Boolean #=zJg0qn1c=, Stream #=zbJ4sSmYuRcGQCHbbQIj2rOE=)
at Aspose.Pdf.XImageCollection.#=zUs9M$4E=(Stream #=zSTPS3Fc=, Int32 #=zgZgb6V8=, Boolean #=z3NM8PT7_YXDC, ImageFilterType #=znildsQc=, Boolean #=zJg0qn1c=, Stream #=zbJ4sSmYuRcGQCHbbQIj2rOE=)
at Aspose.Pdf.Page.#=z71UQrIA=(Stream #=zSTPS3Fc=, Rectangle #=ziKptALY=, Matrix #=zHspMqOEdvvPN, CompositingParameters #=zhZaVNfFY$TrEJENnthVuRwA=, Boolean #=z4WIIdWI=, Boolean #=z3NM8PT7_YXDC, #=zFjemt2LbUYnIZ$RtiqcEUMLdWT4oHo386g==& #=zcxsnbw0ekSoq, Stream #=zbJ4sSmYuRcGQCHbbQIj2rOE=, Boolean #=zVQ4etSg=, Int32 #=zhZz13R8D23LB)
at Aspose.Pdf.Page.#=z71UQrIA=(Stream #=zSTPS3Fc=, Rectangle #=ziKptALY=, CompositingParameters #=zhZaVNfFY$TrEJENnthVuRwA=, Boolean #=z4WIIdWI=, Boolean #=z3NM8PT7_YXDC, Stream #=zbJ4sSmYuRcGQCHbbQIj2rOE=, Boolean #=zVQ4etSg=, Int32 #=zhZz13R8D23LB)
at Aspose.Pdf.Image.#=zToapkrg=(Double& #=zIMGides=, Double& #=zJoXdnoo=, Double& #=zKLvZ3Ts=, Boolean #=z6zs83seze3Pg, MarginInfo #=zd51tBlQ=, Double #=zSbRjuZsCiVM7, Double #=zBiBCnds=, Page #=zBdVDYsQ=, List`1 #=z1TdFx$M=, Boolean #=zT6fCl3Bozq6z, Boolean #=zWyyGG8A5voyM, Boolean #=zMpug9ts=, Paragraphs& #=zXZh4CSEoRLhk2olkhQ==, Double #=zhsJQuVDLdNDkPuQEWQ==, Double #=zIFcNHH4=, Int32 #=znuNccY$EuSHvcL3gbhL7bsk=)
at #=zZfh_Fze6sbxRhUzJvIQoXRc=.#=zToapkrg=()
at Aspose.Pdf.Page.#=z41eQlcc=(Page #=zBdVDYsQ=)
at Aspose.Pdf.Page.#=zrgVRcWEWKuVDbfr4Ow==()
at Aspose.Pdf.Document.ProcessParagraphs()
at Aspose.Pdf.Document.#=zK2KzxWYW6IXP(Stream #=zrO5u_so=, SaveOptions #=zuBOVy7thULtl)
at Aspose.Pdf.Document.#=zB0WnsfwY8HBL(String #=zKuN5UfSP2rqM)
at Aspose.Pdf.Document.Save(String outputFileName)

Can u please provide me your help ?

I run this code in a Microsoft Window Server 2003 R2, Standard Edition, Service Pack 2, and server feautures in attachment.

file.PNG.jpg (144.3 KB)

server_caracheteristic.jpg (6.2 KB)

@deltapro

Thank you for contacting support.

Would you please specify if you are facing this file specific issue with JPG or PNG image? Please share the PNG image as a ZIP file if you are working with PNG format. Moreover, kindly ensure using Aspose.PDF for .NET 19.3 before sharing requested data and information.

I face this issue with PNG.
Yes I already tried with version 19.3
Regards,

Fabio

file.zip (1.3 MB)

@deltapro

Thank you for sharing requested data.

We are unable to reproduce the issue in Windows 10 environment although the results do not usually differ based on platforms in case of .NET framework. However, we will be setting up Windows Server environment and will share our findings with you soon.

Hello any update for me ?
Regards

@deltapro

Thank you for following up.

A ticket with ID PDFNET-47140 is logged in our issue management system for further investigations and resolution of the problem while working with attached image. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-47140) have been fixed in Aspose.PDF for .NET 23.2.