Package com.itextpdf.layout.properties
Enum ObjectFit
- java.lang.Object
-
- java.lang.Enum<ObjectFit>
-
- com.itextpdf.layout.properties.ObjectFit
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONTAIN
If object-fit set to CONTAIN, image will be scaled keeping its aspect ratio to fit in the content box.COVER
If object-fit set to COVER, image will be scaled keeping its aspect ratio to cover the content box.FILL
If object-fit set to FILL, image will be sized to fill the element's content box.NONE
If object-fit set to NONE, image will not be scaled.SCALE_DOWN
If object-fit set to SCALE_DOWN, image will be scaled keeping its aspect ratio to fit in the content box but scaling coefficient cannot be greater than 1.
-
Constructor Summary
Constructors Modifier Constructor Description private
ObjectFit()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectFit
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ObjectFit[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FILL
public static final ObjectFit FILL
If object-fit set to FILL, image will be sized to fill the element's content box. This can change the aspect-ratio of the image.
-
CONTAIN
public static final ObjectFit CONTAIN
If object-fit set to CONTAIN, image will be scaled keeping its aspect ratio to fit in the content box. The whole picture will be rendered in the document but some are of the image container might be blank.
-
COVER
public static final ObjectFit COVER
If object-fit set to COVER, image will be scaled keeping its aspect ratio to cover the content box. The image will be clipped to fit the container's bounds.
-
SCALE_DOWN
public static final ObjectFit SCALE_DOWN
If object-fit set to SCALE_DOWN, image will be scaled keeping its aspect ratio to fit in the content box but scaling coefficient cannot be greater than 1. If content box is greater than the image, picture will be rendered in its original size leaving the rest area of the container blank.
-
NONE
public static final ObjectFit NONE
If object-fit set to NONE, image will not be scaled. It will keep its original size. If the content box is greater than image it will contain blank areas, otherwise picture will be clipped to fit the container's bounds.
-
-
Method Detail
-
values
public static ObjectFit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ObjectFit c : ObjectFit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ObjectFit valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-