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

Free Support Forum - aspose.com

Image to PDF: How to set orientation (C# .NET)

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.

Hello, I’m curious if there has been a fix for this issue. I’m using Aspose.Imaging for .NET 19.12 version and have an image that opens in portrait mode but when converting to PDF, the image is in landscape.


I have observed the issue shared by you and request you to please share the source file, generated output and used sample code. We will investigate and log the issue in our issue tracking system if issue is reproduced based on provided information.

Thank you reaching out. My company recently upgraded to Paid Support so I have been communicating with that team for now.


Thank you for sharing the intimation. You can consult free support any time if you require too as well.