Esempio n. 1
0
        internal CT_Shape newCommentShape()
        {
            CT_Shape shape = new CT_Shape();

            shape.id        = "_x0000_s" + (++_shapeId);
            shape.type      = "#" + _shapeTypeId;
            shape.style     = "position:absolute; visibility:hidden";
            shape.fillcolor = ("#ffffe1");
            shape.insetmode = (ST_InsetMode.auto);
            shape.AddNewFill().color = ("#ffffe1");
            CT_Shadow shadow         = shape.AddNewShadow();

            shadow.on       = NPOI.OpenXmlFormats.Vml.ST_TrueFalse.t;
            shadow.color    = "black";
            shadow.obscured = NPOI.OpenXmlFormats.Vml.ST_TrueFalse.t;
            shape.AddNewPath().connecttype = (ST_ConnectType.none);
            shape.AddNewTextbox().style    = ("mso-direction-alt:auto");
            CT_ClientData cldata           = shape.AddNewClientData();

            cldata.ObjectType = ST_ObjectType.Note;
            cldata.AddNewMoveWithCells();
            cldata.AddNewSizeWithCells();
            cldata.AddNewAnchor("1, 15, 0, 2, 3, 15, 3, 16");
            cldata.AddNewAutoFill(ST_TrueFalseBlank.@false);
            cldata.AddNewRow(0);
            cldata.AddNewColumn(0);
            _items.Add(shape);

            return(shape);
        }
Esempio n. 2
0
        internal CT_Shape newCommentShape()
        {
            CT_Shape ctShape = new CT_Shape();

            ctShape.id        = "_x0000_s" + (object)++this._shapeId;
            ctShape.type      = "#" + this._shapeTypeId;
            ctShape.style     = "position:absolute; visibility:hidden";
            ctShape.fillcolor = "#ffffe1";
            ctShape.insetmode = ST_InsetMode.auto;
            ctShape.AddNewFill().color = "#ffffe1";
            CT_Shadow ctShadow         = ctShape.AddNewShadow();

            ctShadow.on       = ST_TrueFalse.t;
            ctShadow.color    = "black";
            ctShadow.obscured = ST_TrueFalse.t;
            ctShape.AddNewPath().connecttype = ST_ConnectType.none;
            ctShape.AddNewTextbox().style    = "mso-direction-alt:auto";
            CT_ClientData ctClientData       = ctShape.AddNewClientData();

            ctClientData.ObjectType = ST_ObjectType.Note;
            ctClientData.AddNewMoveWithCells();
            ctClientData.AddNewSizeWithCells();
            ctClientData.AddNewAnchor("1, 15, 0, 2, 3, 15, 3, 16");
            ctClientData.AddNewAutoFill(ST_TrueFalseBlank.@false);
            ctClientData.AddNewRow(0);
            ctClientData.AddNewColumn(0);
            this._items.Add((object)ctShape);
            return(ctShape);
        }
Esempio n. 3
0
        internal CT_Shape newCommentShape()
        {
            CT_Shape shape = new CT_Shape();

            shape.id = "_x0000_s" + (++_shapeId);
            shape.type ="#_x0000_t" + (++_shapeTypeId);
            shape.style="position:absolute; visibility:hidden";
            shape.fillcolor = ("#ffffe1");
            shape.insetmode = (ST_InsetMode.auto);
            shape.AddNewFill().color=("#ffffe1");
            CT_Shadow shadow = shape.AddNewShadow();
            shadow.on= ST_TrueFalse.t;
            shadow.color = "black";
            shadow.obscured = ST_TrueFalse.t;
            shape.AddNewPath().connecttype = (ST_ConnectType.none);
            shape.AddNewTextbox().style = ("mso-direction-alt:auto");
            CT_ClientData cldata = shape.AddNewClientData();
            cldata.ObjectType=ST_ObjectType.Note;
            cldata.AddNewMoveWithCells();
            cldata.AddNewSizeWithCells();
            cldata.AddNewAnchor("1, 15, 0, 2, 3, 15, 3, 16");
            cldata.AddNewAutoFill(ST_TrueFalseBlank.@false);
            cldata.AddNewRow(0);
            cldata.AddNewColumn(0);
            _items.Add(shape);

            return shape;
        }
Esempio n. 4
0
        /*
         * This is the default Watermark paragraph; the only variable is the text message
         * TODO: manage all the other variables
         */
        private XWPFParagraph GetWatermarkParagraph(String text, int idx)
        {
            CT_P p = new CT_P();

            byte[] rsidr        = doc.Document.body.GetPArray(0).rsidR;
            byte[] rsidrdefault = doc.Document.body.GetPArray(0).rsidRDefault;
            p.rsidP        = (rsidr);
            p.rsidRDefault = (rsidrdefault);
            CT_PPr pPr = p.AddNewPPr();

            pPr.AddNewPStyle().val = ("Header");
            // start watermark paragraph
            NPOI.OpenXmlFormats.Wordprocessing.CT_R r = p.AddNewR();
            CT_RPr rPr = r.AddNewRPr();

            rPr.AddNewNoProof();
            CT_Picture pict = r.AddNewPict();

            CT_Group     group     = new CT_Group();
            CT_Shapetype shapetype = group.AddNewShapetype();

            shapetype.id        = ("_x0000_t136");
            shapetype.coordsize = ("1600,21600");
            shapetype.spt       = (136);
            shapetype.adj       = ("10800");
            shapetype.path2     = ("m@7,0l@8,0m@5,21600l@6,21600e");
            CT_Formulas formulas = shapetype.AddNewFormulas();

            formulas.AddNewF().eqn = ("sum #0 0 10800");
            formulas.AddNewF().eqn = ("prod #0 2 1");
            formulas.AddNewF().eqn = ("sum 21600 0 @1");
            formulas.AddNewF().eqn = ("sum 0 0 @2");
            formulas.AddNewF().eqn = ("sum 21600 0 @3");
            formulas.AddNewF().eqn = ("if @0 @3 0");
            formulas.AddNewF().eqn = ("if @0 21600 @1");
            formulas.AddNewF().eqn = ("if @0 0 @2");
            formulas.AddNewF().eqn = ("if @0 @4 21600");
            formulas.AddNewF().eqn = ("mid @5 @6");
            formulas.AddNewF().eqn = ("mid @8 @5");
            formulas.AddNewF().eqn = ("mid @7 @8");
            formulas.AddNewF().eqn = ("mid @6 @7");
            formulas.AddNewF().eqn = ("sum @6 0 @5");
            CT_Path path           = shapetype.AddNewPath();

            path.textpathok    = (NPOI.OpenXmlFormats.Vml.ST_TrueFalse.t);
            path.connecttype   = (ST_ConnectType.custom);
            path.connectlocs   = ("@9,0;@10,10800;@11,21600;@12,10800");
            path.connectangles = ("270,180,90,0");
            CT_TextPath shapeTypeTextPath = shapetype.AddNewTextpath();

            shapeTypeTextPath.on       = (NPOI.OpenXmlFormats.Vml.ST_TrueFalse.t);
            shapeTypeTextPath.fitshape = (NPOI.OpenXmlFormats.Vml.ST_TrueFalse.t);
            CT_Handles handles = shapetype.AddNewHandles();
            CT_H       h       = handles.AddNewH();

            h.position = ("#0,bottomRight");
            h.xrange   = ("6629,14971");
            NPOI.OpenXmlFormats.Vml.Office.CT_Lock lock1 = shapetype.AddNewLock();
            lock1.ext = (ST_Ext.edit);
            CT_Shape shape = group.AddNewShape();

            shape.id    = ("PowerPlusWaterMarkObject" + idx);
            shape.spid  = ("_x0000_s102" + (4 + idx));
            shape.type  = ("#_x0000_t136");
            shape.style = ("position:absolute;left:0;text-align:left;margin-left:0;margin-top:0;width:415pt;height:73.15pt;rotation:315;z-index:-251654144;mso-wrap-edited:f;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin");
            //shape.wrapcoords = ("616 5068 390 16297 39 16921 -39 17155 7265 17545 7186 17467 -39 17467 18904 17467 10507 17467 8710 17545 18904 17077 18787 16843 18358 16297 18279 12554 19178 12476 20701 11774 20779 11228 21131 10059 21248 8811 21248 7563 20975 6316 20935 5380 19490 5146 14022 5068 2616 5068");
            shape.fillcolor = "silver";
            shape.stroked   = (NPOI.OpenXmlFormats.Vml.ST_TrueFalse.@false);
            CT_TextPath shapeTextPath = shape.AddNewTextpath();

            shapeTextPath.style   = "font-family:\"Cambria\";;font-size:1pt";
            shapeTextPath.@string = (text);
            var shapefill = shape.AddNewFill();

            shapefill.opacity = ".5";
            pict.Set(group);
            // end watermark paragraph
            return(new XWPFParagraph(p, doc));
        }