예제 #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.Core.OpenXmlFormats.Wordprocessing.CT_Color color = pr.IsSetColor() ? pr.color : pr.AddNewColor();
            color.val = (rgbStr);
        }
예제 #2
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.Core.OpenXmlFormats.Wordprocessing.CT_Color clr = pr.color;
                    color = clr.val; //clr.xgetVal().getStringValue();
                }
            }
            return(color);
        }