DsPdfJS API - v9.1.0
    Preparing search index...

    Class Transform

    Represents a 3x2 transformation matrix.

    Hierarchy (View Summary)

    Index

    Accessors

    • get id(): number

      Gets the reference to the object.

      Returns number

    • get matrix(): number[]

      Gets or sets the transformation matrix. The matrix consists of six numbers (their meaning is simplified for clarity): m11 - scales the drawing horizontally m12 - skew the the drawing horizontally m21 - skew the the drawing vertically m22 - scales the drawing vertically m31 - moves the the drawing horizontally m32 - moves the the drawing vertically

      Returns number[]

    • set matrix(matrix: number[]): void

      Gets or sets the transformation matrix. The matrix consists of six numbers (their meaning is simplified for clarity): m11 - scales the drawing horizontally m12 - skew the the drawing horizontally m21 - skew the the drawing vertically m22 - scales the drawing vertically m31 - moves the the drawing horizontally m32 - moves the the drawing vertically

      Parameters

      • matrix: number[]

      Returns void

    Methods

    • Creates a transformation based on the specified 3x2 matrix.

      Parameters

      • m11: number

        Scales the drawing horizontally

      • m12: number

        Skew the the drawing horizontally

      • m21: number

        Skew the the drawing vertically

      • m22: number

        Scales the drawing vertically

      • m31: number

        Moves the the drawing horizontally

      • m32: number

        Moves the the drawing vertically

      Returns Transform

      A new instance of Transform.

    • Creates a transformation based on the specified 3x2 matrix.

      Parameters

      • om: ObjectManager

        An object manager that controls the lifetime of the Transform object.

      • m11: number

        Scales the drawing horizontally

      • m12: number

        Skew the the drawing horizontally

      • m21: number

        Skew the the drawing vertically

      • m22: number

        Scales the drawing vertically

      • m31: number

        Moves the the drawing horizontally

      • m32: number

        Moves the the drawing vertically

      Returns Transform

      A new instance of Transform.

    • Creates a rotation transformation.

      Parameters

      • angle: number

        The rotation angle.

      • OptionalangleUnits: AngleUnits

        The angle units. The default is Degrees.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns Transform

      A new instance of Transform.

    • Creates a rotation transformation.

      Parameters

      • om: ObjectManager

        An object manager that controls the lifetime of the Transform object.

      • angle: number

        The rotation angle.

      • OptionalangleUnits: AngleUnits

        The angle units. The default is Degrees.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns Transform

      A new instance of Transform.

    • Creates a scaling transformation.

      Parameters

      • scaleFactor: number

        The value to scale by on the X and Y axes.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns Transform

      A new instance of Transform.

    • Creates a scaling transformation.

      Parameters

      • om: ObjectManager

        An object manager that controls the lifetime of the Transform object.

      • scaleFactor: number

        The value to scale by on the X and Y axes.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns Transform

      A new instance of Transform.

    • Creates a scaling transformation.

      Parameters

      • scaleX: number

        The value to scale by on the X axis.

      • scaleY: number

        The value to scale by on the Y axis.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns Transform

      A new instance of Transform.

    • Creates a scaling transformation.

      Parameters

      • om: ObjectManager

        An object manager that controls the lifetime of the Transform object.

      • scaleX: number

        The value to scale by on the X axis.

      • scaleY: number

        The value to scale by on the Y axis.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns Transform

      A new instance of Transform.

    • Creates a skew transformation.

      Parameters

      • angleX: number

        The X angle.

      • angleY: number

        The Y angle.

      • OptionalangleUnits: AngleUnits

        The angle units. The default is Degrees.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns Transform

      A new instance of Transform.

    • Creates a skew transformation.

      Parameters

      • om: ObjectManager

        An object manager that controls the lifetime of the Transform object.

      • angleX: number

        The X angle.

      • angleY: number

        The Y angle.

      • OptionalangleUnits: AngleUnits

        The angle units. The default is Degrees.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns Transform

      A new instance of Transform.

    • Creates a translation transformation.

      Parameters

      • offsetX: number

        The horizontal offset.

      • offsetY: number

        The vertical offset.

      Returns Transform

      A new instance of Transform.

    • Creates a translation transformation.

      Parameters

      • om: ObjectManager

        An object manager that controls the lifetime of the Transform object.

      • offsetX: number

        The horizontal offset.

      • offsetY: number

        The vertical offset.

      Returns Transform

      A new instance of Transform.

    • Applies the transformation to the current instance.

      Parameters

      • transform: Transform

        The Transform object to be multiplied by the current transformation matrix.

      Returns void

    • Detaches the object from the ObjectManager and deallocates its memory, if possible.

      Returns void

    • Restores the previously pushed transformation from the stack.

      Returns void

    • Saves the current transformation to the stack.

      Returns void

    • Resets the transformation to the identity matrix.

      Returns void

    • Applies the rotation transformation.

      Parameters

      • angle: number

        The rotation angle.

      • OptionalangleUnits: AngleUnits

        The angle units. The default is Degrees.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns void

    • Applies the scaling transformation.

      Parameters

      • scaleFactor: number

        The value to scale by on the X and Y axes.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns void

    • Applies the scaling transformation.

      Parameters

      • scaleX: number

        The value to scale by on the X axis.

      • scaleY: number

        The value to scale by on the Y axis.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns void

    • Sets the transformation to the current instance.

      Parameters

      Returns void

    • Applies the skew transformation.

      Parameters

      • angleX: number

        The X angle.

      • angleY: number

        The Y angle.

      • OptionalangleUnits: AngleUnits

        The angle units. The default is Degrees.

      • Optionalcx: number

        The optional center point X offset.

      • Optionalcy: number

        The optional center point Y offset.

      Returns void

    • Applies the skew transformation along the X axis.

      Parameters

      • angle: number

        The X angle.

      • OptionalangleUnits: AngleUnits

        The angle units. The default is Degrees.

      Returns void

    • Applies the skew transformation along the Y axis.

      Parameters

      • angle: number

        The Y angle.

      • OptionalangleUnits: AngleUnits

        The angle units. The default is Degrees.

      Returns void

    • Transforms an array of Points by the transformation matrix.

      Parameters

      Returns Point[]

      The array of transformed Points.

    • Applies the translation transformation.

      Parameters

      • offsetX: number

        The horizontal offset.

      • offsetY: number

        The vertical offset.

      Returns void

    • Inverts the transformation matrix, if possible.

      Returns boolean

      true on success, false otherwise.