[]
        
(Showing Draft Content)

RotationPlugin

Document Solutions Image Viewer - v7.2.0 / RotationPlugin

Class: RotationPlugin

RotationPlugin class. Adds the "Rotate Image" button.

Deprecated

Deprecated in favor of PageToolsPlugin.

Description

Available options are:

  • rotatePosition - position of the "Rotate Image" button.
  • flipHorizontalPosition - position of the "Flip horizontal" button.
  • flipVerticalPosition - position of the "Flip vertical" button.

Example

<script src="gcimageviewer.js"></script></head>
<script src="plugins/rotation.js"></script>
<script>
  var viewer = new GcImageViewer("#root");
  viewer.addPlugin(new RotationPlugin());
</script>

Param

Table of contents

Properties

Constructors

Methods

Properties

id

Readonly id: string = "rotation"

Unique plugin identifier.


options

options: RotationPluginOptions

Plugin options

Constructors

constructor

new RotationPlugin(options?)

RotationPlugin constructor.

Parameters

Name Type
options? RotationPluginOptions

Methods

getRotation

getRotation(): number

Specifies the rotation in degrees.

Returns

number


setRotation

setRotation(val): Promise<boolean>

Specifies the rotation in degrees.

Parameters

Name Type
val number

Returns

Promise<boolean>


isImageFormatSupported

isImageFormatSupported(imageFormat): boolean

Checks if the image format specified by the imageFormat parameter is supported.

Parameters

Name Type
imageFormat string | ImageFormatCode

Returns

boolean


flip

flip(horizontal?, vertical?): Promise<boolean>

Flip image.

Parameters

Name Type Default value
horizontal boolean true
vertical boolean false

Returns

Promise<boolean>


flipHorizontal

flipHorizontal(): Promise<boolean>

Flip image horizontally.

Returns

Promise<boolean>


flipVertical

flipVertical(): Promise<boolean>

Flip image vertically.

Returns

Promise<boolean>