ComPDFKit Web SDK
    Preparing search index...

    Variable RotationUtilsConst

    RotationUtils: {
        getRotatedBoundingBoxRectFromRectangularAnnotations(
            box: { height: number; width: number; x: number; y: number },
            angle: number,
            center?: Core.Annotations.Point,
        ): Core.Annotations.Rect;
        getRotatedPointsArray(
            points: Core.Annotations.Point[],
            center: Core.Annotations.Point,
            angle: number,
        ): Core.Annotations.Point[];
        getRotationAngleInRadiansByDegrees(degrees: number): number;
        getUnrotatedDimensionsFromRectangularAnnotations(
            rect: { x1: number; x2: number; y1: number; y2: number },
            angle: number,
        ): { height: number; width: number; x: number; y: number };
    }

    Rotation geometry helpers.

    Type Declaration

    • getRotatedBoundingBoxRectFromRectangularAnnotations: function
      • Bounding box of the unrotated box (x, y, width, height) after rotating by angle around center (the box center by default).

        Parameters

        • box: { height: number; width: number; x: number; y: number }
          • height: number

            Height.

          • width: number

            Width.

          • x: number

            Left edge.

          • y: number

            Top edge.

        • angle: number
        • Optionalcenter: Core.Annotations.Point

        Returns Core.Annotations.Rect

    • getRotatedPointsArray: function
    • getRotationAngleInRadiansByDegrees: function
      • Converts degrees to radians.

        Parameters

        • degrees: number

          Angle in degrees.

        Returns number

        Angle in radians.

    • getUnrotatedDimensionsFromRectangularAnnotations: function
      • For a rectangle-type annotation rotated by angle: derives the unrotated box from the bounding box rect (centered in the bounding box).

        Parameters

        • rect: { x1: number; x2: number; y1: number; y2: number }
          • x1: number

            Left edge.

          • x2: number

            Right edge.

          • y1: number

            Top edge.

          • y2: number

            Bottom edge.

        • angle: number

        Returns { height: number; width: number; x: number; y: number }

        • height: number

          Height of the unrotated box.

        • width: number

          Width of the unrotated box.

        • x: number

          Left edge of the unrotated box.

        • y: number

          Top edge of the unrotated box.