Exemplo n.º 1
0
        /**
         * Set text color.
         * @param rgbStr - the desired color, in the hex form "RRGGBB".
         */
        public void SetColor(String rgbStr)
        {
            CT_RPr pr = run.IsSetRPr() ? run.rPr : run.AddNewRPr();

            NPOI.OpenXmlFormats.Wordprocessing.CT_Color color = pr.IsSetColor() ? pr.color : pr.AddNewColor();
            color.val = (rgbStr);
        }
Exemplo n.º 2
0
        /**
         * Set text color.
         * @param rgbStr - the desired color, in the hex form "RRGGBB".
         */
        public void SetColor(String rgbStr)
        {
            CT_RPr pr = GetRunProperties(true);

            NPOI.OpenXmlFormats.Wordprocessing.CT_Color color = pr.IsSetColor() ? pr.color : pr.AddNewColor();
            color.val = (rgbStr);
        }
Exemplo n.º 3
0
        /**
         * Get text color. The returned value is a string in the hex form "RRGGBB".
         */
        public String GetColor()
        {
            String color = null;

            if (run.IsSetRPr())
            {
                CT_RPr pr = run.rPr;
                if (pr.IsSetColor())
                {
                    NPOI.OpenXmlFormats.Wordprocessing.CT_Color clr = pr.color;
                    color = clr.val; //clr.xgetVal().getStringValue();
                }
            }
            return(color);
        }
Exemplo n.º 4
0
 public static CT_Color Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_Color ctObj = new CT_Color();
     ctObj.val = XmlHelper.ReadString(node.Attributes["val"]);
     if (node.Attributes["themeColor"] != null)
         ctObj.themeColor = (ST_ThemeColor)Enum.Parse(typeof(ST_ThemeColor), node.Attributes["themeColor"].Value);
     ctObj.themeTint = XmlHelper.ReadBytes(node.Attributes["themeTint"]);
     ctObj.themeShade = XmlHelper.ReadBytes(node.Attributes["themeShade"]);
     return ctObj;
 }
Exemplo n.º 5
0
 public CT_FramesetSplitbar()
 {
     this.flatBordersField = new CT_OnOff();
     this.noBorderField = new CT_OnOff();
     this.colorField = new CT_Color();
     this.wField = new CT_TwipsMeasure();
 }