[]
Document Solutions Image Viewer - v8.0.0 / PageToolsPlugin
PageToolsPlugin class. Adds the "Page tools" button.
Example
<script src="gcimageviewer.js"></script></head>
<script src="plugins/pageTools.js"></script>
<script>
var viewer = new DsImageViewer("#root");
viewer.addPlugin(new PageToolsPlugin());
</script>
Param
• Readonly
id: string
= "pageTools"
Unique plugin identifier.
• options: PageToolsPluginOptions
Plugin options
• new PageToolsPlugin(options?
)
PageToolsPlugin constructor.
Name | Type | Description |
---|---|---|
options? |
PageToolsPluginOptions |
plugin options |
• get
isReady(): boolean
Returns true if the image is loaded into the viewer and the image format is supported by the Page Tools plugin.
boolean
• get
naturalSize(): Object
Natural image size.
Object
Name | Type |
---|---|
width |
number |
height |
number |
• get
totalRotation(): number
Gets current rotation in degrees.
number
▸ rotate(rotation
): Promise
<boolean
>
Rotate image.
Name | Type |
---|---|
rotation |
number |
Promise
<boolean
>
▸ isImageFormatSupported(imageFormat
, allowUnknown?
): boolean
Checks if the image format specified by the imageFormat parameter is supported.
Name | Type |
---|---|
imageFormat |
string | ImageFormatCode |
allowUnknown? |
boolean |
boolean
▸ crop(x
, y
, width
, height
): Promise
<boolean
>
Crop image.
Name | Type |
---|---|
x |
number |
y |
number |
width |
number |
height |
number |
Promise
<boolean
>
▸ resize(width
, height
, keepAspectRatio?
): Promise
<boolean
>
Resize image.
Name | Type | Default value |
---|---|---|
width |
number |
undefined |
height |
number |
undefined |
keepAspectRatio |
boolean |
true |
Promise
<boolean
>
▸ flip(horizontal?
, vertical?
): Promise
<boolean
>
Flip image.
Name | Type | Default value |
---|---|---|
horizontal |
boolean |
true |
vertical |
boolean |
false |
Promise
<boolean
>
▸ flipHorizontal(): Promise
<boolean
>
Flip image horizontally.
Promise
<boolean
>
▸ flipVertical(): Promise
<boolean
>
Flip image vertically.
Promise
<boolean
>