[]
PageToolsPlugin class. Adds the "Page tools" button.
<script src="gcimageviewer.js"></script></head>
<script src="plugins/pageTools.js"></script>
<script>
var viewer = new DsImageViewer("#root");
viewer.addPlugin(new PageToolsPlugin());
</script>
new PageToolsPlugin(options?): PageToolsPlugin;
PageToolsPlugin constructor.
plugin options
PageToolsPlugin
readonly id: string;
Unique plugin identifier.
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
height: number;
width: number;
get totalRotation(): number;
Gets current rotation in degrees.
number
crop(
x,
y,
width,
height): Promise<boolean>;
Crop image.
number
number
number
number
Promise
<boolean
>
flip(horizontal?, vertical?): Promise<boolean>;
Flip image.
boolean
boolean
Promise
<boolean
>
flipHorizontal(): Promise<boolean>;
Flip image horizontally.
Promise
<boolean
>
flipVertical(): Promise<boolean>;
Flip image vertically.
Promise
<boolean
>
isImageFormatSupported(imageFormat, allowUnknown?): boolean;
Checks if the image format specified by the imageFormat parameter is supported.
string
| ImageFormatCode
boolean
boolean
resize(
width,
height,
keepAspectRatio?): Promise<boolean>;
Resize image.
number
number
boolean
Promise
<boolean
>
rotate(rotation): Promise<boolean>;
Rotate image.
number
Promise
<boolean
>