I am using Itextsharp to put some images into PDF. Some of these images are large (3600h by 2500w) and some bit small (1000h by 700w). My PDF page is 842H by 737H.
Some of these large images will not fit into potrait so i am flipping images where the width > height.
img.RotationDegrees = 90f;
Now my problem is how do i scale the images so they all scale and fit into the page perfectly?
I tried using
var scalePercent= (PDFPage.Width / img.Width) * 100;
img.ScalePercent(scalePercent);
but this didnt work for most images, specially small images.