Class ObjectFitCalculator

java.lang.Object
com.itextpdf.layout.renderer.objectfit.ObjectFitCalculator

public final class ObjectFitCalculator extends Object
Utility class which supports the ObjectFit property.
  • Method Details

    • calculateRenderedImageSize

      public static ObjectFitApplyingResult calculateRenderedImageSize (ObjectFit objectFit, double absoluteImageWidth, double absoluteImageHeight, double imageContainerWidth, double imageContainerHeight)
      Calculates size of image to be render when certain ObjectFit mode is applied. The width or the height of the image might be greater than the same property of the image in a document. In this case parts of the image will not be shown.
      Parameters:
      objectFit - is an object-fit mode
      absoluteImageWidth - is a width of the original image
      absoluteImageHeight - is a height of the original image
      imageContainerWidth - is a width of the image to draw
      imageContainerHeight - is a width of the image to draw
      Returns:
      results of object-fit mode applying as an ObjectFitApplyingResult object