Community
Participate
Working Groups
double width = WordUtil.convertImageSize( image.getWidth( ), defaultW );
// recalculate the width ,height according to the cellwidth
double originalRatio = height / width;
// //1 inch = 25.4mm 72pt = 1 inch
// pt is absolute measure different from relative measure px
double cellWidth = WordUtil.twipToPt( context.getCurrentWidth( ) );
if ( width > cellWidth )
{
width = cellWidth;
height = (int) ( width * originalRatio );
}