java.lang.Object
eu.europa.esig.dss.pdf.visible.ImageRotationUtils
Contains utils for the image rotation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault 0 degreesstatic final int180 degreesstatic final int270 degreesstatic final int360 degrees (= 0 degrees)static final int90 degreesstatic final StringA message with supported angles -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationBoxensureNoRotate(AnnotationBox annotationBox, int pageRotation) This method is used to ensure the annotation wrapping box defines correct coordinates relatively the "noRotate" flagstatic intgetRotation(eu.europa.esig.dss.enumerations.VisualSignatureRotation visualSignatureRotation) Returns rotation parameter not depending on the page rotationstatic intgetRotation(eu.europa.esig.dss.enumerations.VisualSignatureRotation visualSignatureRotation, int pageRotation) Returns rotation based on the page's default rotation parameterstatic booleanisSwapOfDimensionsRequired(int rotation) Verifies if swap of dimensions is required with the current rotationstatic booleanisSwapOfDimensionsRequired(eu.europa.esig.dss.enumerations.VisualSignatureRotation rotation) Verifies if swap of dimensions is required with the current rotationstatic AnnotationBoxrotateRelativelyWrappingBox(AnnotationBox annotationBox, AnnotationBox wrappingBox, int rotation) This method rotates the givenannotationBoxrelatively thewrappingBoxaccording to the givenrotationstatic AnnotationBoxswapDimensions(AnnotationBox annotationBox) This method swaps dimensions of the givenAnnotationBox
-
Field Details
-
SUPPORTED_ANGLES_ERROR_MESSAGE
A message with supported angles- See Also:
-
ANGLE_0
public static final int ANGLE_0Default 0 degrees- See Also:
-
ANGLE_90
public static final int ANGLE_9090 degrees- See Also:
-
ANGLE_180
public static final int ANGLE_180180 degrees- See Also:
-
ANGLE_270
public static final int ANGLE_270270 degrees- See Also:
-
ANGLE_360
public static final int ANGLE_360360 degrees (= 0 degrees)- See Also:
-
-
Method Details
-
getRotation
public static int getRotation(eu.europa.esig.dss.enumerations.VisualSignatureRotation visualSignatureRotation) Returns rotation parameter not depending on the page rotation- Parameters:
visualSignatureRotation-VisualSignatureRotation- Returns:
- int rotation angle
-
getRotation
public static int getRotation(eu.europa.esig.dss.enumerations.VisualSignatureRotation visualSignatureRotation, int pageRotation) Returns rotation based on the page's default rotation parameter- Parameters:
visualSignatureRotation-VisualSignatureRotationpageRotation- the rotation of a page- Returns:
- int rotation angle
-
isSwapOfDimensionsRequired
public static boolean isSwapOfDimensionsRequired(int rotation) Verifies if swap of dimensions is required with the current rotation- Parameters:
rotation-introtation degree- Returns:
- TRUE is swap of dimensions is required, FALSE otherwise
-
isSwapOfDimensionsRequired
public static boolean isSwapOfDimensionsRequired(eu.europa.esig.dss.enumerations.VisualSignatureRotation rotation) Verifies if swap of dimensions is required with the current rotation- Parameters:
rotation-VisualSignatureRotation- Returns:
- TRUE is swap of dimensions is required, FALSE otherwise
-
swapDimensions
This method swaps dimensions of the givenAnnotationBox- Parameters:
annotationBox-AnnotationBox- Returns:
AnnotationBox
-
rotateRelativelyWrappingBox
public static AnnotationBox rotateRelativelyWrappingBox(AnnotationBox annotationBox, AnnotationBox wrappingBox, int rotation) This method rotates the givenannotationBoxrelatively thewrappingBoxaccording to the givenrotation- Parameters:
annotationBox-AnnotationBoxto rotatewrappingBox-AnnotationBoxrepresenting wrapping boxrotation- rotation degree- Returns:
AnnotationBox
-
ensureNoRotate
This method is used to ensure the annotation wrapping box defines correct coordinates relatively the "noRotate" flag- Parameters:
annotationBox-AnnotationBoxcontaining coordinates extracted from PDF documentpageRotation- the page rotation degree- Returns:
AnnotationBoxwith coordinates for the "noRotate" flag annotation relatively the page's rotation
-