Jpeg to Pdf convertion, some pages getting blackout

I have an application that used aspose.pdf 22.2 version to convert multiple jpeg files to single PDF. but after conversion, one page getting fully blackout. But it is working fine with older 11.5 version. Below is the code I have used

	foreach (var attachment in workItem.Attachments)
                {
                    
                        ms = new MemoryStream(attachment.FileContent);
                        Bitmap myimage = new Bitmap(ms);

                        FrameDimension dimension = new FrameDimension(myimage.FrameDimensionsList[0]);
                        int frameCount = myimage.GetFrameCount(dimension);
                        Aspose.Pdf.Image OutImage = null;

                        for (int frameIdx = 0; frameIdx < frameCount; frameIdx++)
                        {
                            Page sec = pdfDoc.Pages.Add();

                            myimage.SelectActiveFrame(dimension, frameIdx);

                            currentImage = new MemoryStream();
                            myimage.Save(currentImage, ImageFormat.Jpeg);

                            OutImage = new Aspose.Pdf.Image();
                            OutImage.ImageStream = currentImage;
                            sec.Paragraphs.Add(OutImage);
                        }
                    
                }
               
                if (pdfDoc != null)
                {
                   
                    pdfDoc.Save(outputPDF);
	    }

@sreenath2020

Please upgrade to the latest version of Aspose.PDF for .NET 22.8 and let us know how it goes on your side.

If you still face problem, please attach the following resources here for testing:

  • Your input document.
  • Please attach the output file that shows the undesired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.