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

Hierarchy

  • PageToolsPlugin

Properties

id: string = "pageTools"

Unique plugin identifier.

Plugin options

Constructors

Accessors

  • get isReady(): boolean
  • Returns true if the image is loaded into the viewer and the image format is supported by the Page Tools plugin.

    Returns boolean

  • get naturalSize(): { width: number; height: number }
  • Natural image size.

    Returns { width: number; height: number }

    • width: number
    • height: number
  • get totalRotation(): number
  • Gets current rotation in degrees.

    Returns number

Methods

  • Rotate image.

    Parameters

    • rotation: number

    Returns Promise<boolean>

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

    Parameters

    Returns boolean

  • Crop image.

    Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns Promise<boolean>

  • Resize image.

    Parameters

    • width: number
    • height: number
    • keepAspectRatio: boolean = true

    Returns Promise<boolean>

  • Flip image.

    Parameters

    • horizontal: boolean = true
    • vertical: boolean = false

    Returns Promise<boolean>

  • Flip image horizontally.

    Returns Promise<boolean>

  • Flip image vertically.

    Returns Promise<boolean>