Package com.itextpdf.layout.properties
Enum ObjectFit
- All Implemented Interfaces:
-
Serializable
,Comparable<ObjectFit>
,java.lang.constant.Constable
A specialized enum holding the possible values for an object-fit property which define the way of fitting the image into the content box with different size.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIf object-fit set to CONTAIN, image will be scaled keeping its aspect ratio to fit in the content box.If object-fit set to COVER, image will be scaled keeping its aspect ratio to cover the content box.If object-fit set to FILL, image will be sized to fill the element's content box.If object-fit set to NONE, image will not be scaled.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. -
Method Summary
-
Enum Constant Details
-
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
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
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
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
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 Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
-
IllegalArgumentException
- if this enum type has no constant with the specified name -
NullPointerException
- if the argument is null
-