question: public Image scaleToFit ( float fitWidth , float fitHeight ) { float horizontalScaling = fitWidth / xObject . getWidth ( ) ; float verticalScaling = fitHeight / xObject . getHeight ( ) ; return scale ( Math . min ( horizontalScaling , verticalScaling ) , Math . min ( horizontalScaling , verticalScaling ) ) ; }
target:  Scale the image to an absolute size. This method will preserve the width-height ratio of the image.