Orientation when converting to pdf


I would like to output an image as PDF using the following code:

                Aspose.Imaging.Image img = Aspose.Imaging.Image.Load(stream);
                Aspose.Imaging.ImageOptions.PdfOptions optImg = new Aspose.Imaging.ImageOptions.PdfOptions();
                optImg.ResolutionSettings= new ResolutionSetting() ;
                img.Save(resultStream, optImg);

This works very well, but the orientation of the images is mostly (but not always) wrong. Portrait images are always rotated 90°, landscape images are mostly (not always) upside down.

How can this be solved?

Second question would be: is it possible to scale the images down from the size before output as PDF (the target would be smaller files)?




I have observed the information shared by you and request you to please first try using latest Aspose.Imaging for .NET 19.4 on your end. In case there is still an issue, please provide the source file along with generated output reproducing the issue.