com.aspose.xps

Class XpsCanvas

  • All Implemented Interfaces:
    Iterable<XpsElement>


    public final class XpsCanvas
    extends XpsElement

    Class incapsulating Canvas element features. This element groups elements together. For example, Glyphs and Path elements can be grouped in a canvas in order to be identified as a unit (as a hyperlink destination) or to apply a composed property value to each child and ancestor element.

    • Method Detail

      • addCanvas

        public XpsCanvas addCanvas()

        Adds a new canvas to this canvas's child list.

        Returns:
        Added canvas.
      • addCanvas

        public XpsCanvas addCanvas(XpsCanvas canvas)

        Adds a canvas to this canvas's child list.

        Parameters:
        canvas - The canvas to be added.
        Returns:
        Added canvas.
      • insertCanvas

        public XpsCanvas insertCanvas(int index)

        Inserts a new canvas to this canvas's child list at index position.

        Parameters:
        index - Position at which a new canvas should be inserted.
        Returns:
        Inserted canvas.
      • insertCanvas

        public XpsCanvas insertCanvas(int index,
                                      XpsCanvas canvas)

        Inserts a canvas to this canvas's child list at index position.

        Parameters:
        index - Position at which a canvas should be inserted.
        canvas - The canvas to be inserted.
        Returns:
        Inserted canvas.
      • addPath

        public XpsPath addPath(XpsPathGeometry data)

        Adds a new path to this canvas's child list.

        Parameters:
        data - The geometry of the path.
        Returns:
        Added path.
      • addPath

        public XpsPath addPath(XpsPath path)

        Adds a path to this canvas's child list.

        Parameters:
        path - A path to be added.
        Returns:
        Added path.
      • insertPath

        public XpsPath insertPath(int index,
                                  XpsPathGeometry data)

        Inserts a new path to this canvas's child list at index position.

        Parameters:
        index - Position at which a new path should be inserted.
        data - The geometry of the path.
        Returns:
        Inserted path.
      • insertPath

        public XpsPath insertPath(int index,
                                  XpsPath path)

        Inserts a path to this canvas's child list at index position.

        Parameters:
        index - Position at which a path should be inserted.
        path - A path to be inserted.
        Returns:
        Inserted path.
      • addGlyphs

        public XpsGlyphs addGlyphs(String fontFamily,
                                   float fontSize,
                                   XpsFontStyle fontStyle,
                                   float originX,
                                   float originY,
                                   String unicodeString)

        Adds new glyphs to this canvas's child list.

        Parameters:
        fontFamily - Font family.
        fontSize - Font size.
        fontStyle - Font style.
        originX - Glyphs origin X coordinate.
        originY - Glyphs origin T coordinate.
        unicodeString - String to be printed.
        Returns:
        Added glyphs.
      • addGlyphs

        public XpsGlyphs addGlyphs(XpsGlyphs glyphs)

        Adds glyphs to this canvas's child list.

        Parameters:
        glyphs - Glyphs to be added.
        Returns:
        Added glyphs.
      • insertGlyphs

        public XpsGlyphs insertGlyphs(int index,
                                      String fontFamily,
                                      float fontSize,
                                      XpsFontStyle fontStyle,
                                      float originX,
                                      float originY,
                                      String unicodeString)

        Inserts new glyphs to this canvas's child list at index position.

        Parameters:
        index - Position at which new glyphs should be inserted.
        fontFamily - Font family.
        fontSize - Font size.
        fontStyle - Font style.
        originX - Glyphs origin X coordinate.
        originY - Glyphs origin T coordinate.
        unicodeString - String to be printed.
        Returns:
        Added glyphs.
      • insertGlyphs

        public XpsGlyphs insertGlyphs(int index,
                                      XpsGlyphs glyphs)

        Inserts glyphs to this canvas's child list.

        Parameters:
        index - Position at which glyphs should be inserted.
        glyphs - Glyphs to be added.
        Returns:
        Inserted glyphs.
      • getRenderTransform

        public XpsMatrix getRenderTransform()

        Returns the affine transformation matrix establishing a new coordinate frame for the child and descendant elements of the canvas, such as another canvas. Also affects clip and opacity mask.

        Returns:
        The affine transformation matrix.
      • setRenderTransform

        public void setRenderTransform(XpsMatrix value)

        Sets the affine transformation matrix establishing a new coordinate frame for the child and descendant elements of the canvas, such as another canvas. Also affects clip and opacity mask.

        Parameters:
        value - The affine transformation matrix.
      • getClip

        public XpsPathGeometry getClip()

        Returns the path geometry limitting the rendered region of the element.

        Returns:
        The path geometry limitting the rendered region of the element.
      • setClip

        public void setClip(XpsPathGeometry value)

        Sets the path geometry limitting the rendered region of the element.

        Parameters:
        value - The path geometry limitting the rendered region of the element.
      • getOpacity

        public float getOpacity()

        Returns the value defining the uniform transparency of the canvas.

        Returns:
        The value defining the uniform transparency of the canvas.
      • setOpacity

        public void setOpacity(float value)

        Sets the value defining the uniform transparency of the canvas.

        Parameters:
        value - The value defining the uniform transparency of the canvas.
      • getOpacityMask

        public XpsBrush getOpacityMask()

        Returns the brush specifying a mask of alpha values that is applied to the canvas in the same fashion as the Opacity attribute, but allowing different alpha values for different areas of the element.

        Returns:
        The brush specifying a mask.
      • setOpacityMask

        public void setOpacityMask(XpsBrush value)

        Sets the brush specifying a mask of alpha values that is applied to the canvas in the same fashion as the Opacity attribute, but allowing different alpha values for different areas of the element.

        Parameters:
        value - The brush specifying a mask.
      • getHyperlinkTarget

        public XpsHyperlinkTarget getHyperlinkTarget()

        Returns The hyperlink target object.

        Returns:
        The hyperlink target object.
      • setHyperlinkTarget

        public void setHyperlinkTarget(XpsHyperlinkTarget value)

        Sets the hyperlink target object.

        Parameters:
        value - The hyperlink target object.
      • getEdgeMode

        public XpsEdgeMode getEdgeMode()

        Returns the value that controls how edges of paths within the canvas are rendered.

        Returns:
        The edge rendering mode.
      • setEdgeMode

        public void setEdgeMode(XpsEdgeMode value)

        Sets the value that controls how edges of paths within the canvas are rendered.

        Parameters:
        value - The edge rendering mode.
      • deepClone

        public XpsCanvas deepClone()

        Clones this canvas.

        Returns:
        Clone of this canvas.