Ejemplo n.º 1
0
 internal void method_80(DocPicture A_0)
 {
     this.docPicture_0 = A_0;
 }
Ejemplo n.º 2
0
    internal static double smethod_5(Class857 A_0, DocumentObject A_1, ShapeObject A_2, Class43 A_3)
    {
        int num = 8;

        if (((A_1 is ShapeObject) && !(A_1 is ShapeGroup)) || (A_1 is TableCell))
        {
            return(double.NaN);
        }
        double   naN    = double.NaN;
        Class396 class2 = A_0.method_11();

        while (class2.method_9(BookmarkStart.b("䠭䈯匱夳匵", num)))
        {
            if (A_0.method_5(A_3))
            {
                continue;
            }
            string str = A_0.method_11().method_1();
            if (str != null)
            {
                if (str != BookmarkStart.b("娭唯䨱䀳ᬵ娷唹䐻", num))
                {
                    if (str != BookmarkStart.b("䜭崯匱匳匵", num))
                    {
                        if (!(str == BookmarkStart.b("䄭刯報儳唵䰷", num)))
                        {
                            if (!(str == BookmarkStart.b("䄭刯報儳唵䰷᜹医刽┿", num)))
                            {
                                goto Label_011A;
                            }
                            A_2.SetShapeType(ShapeType.OleObject);
                            Class798.smethod_0(A_0, A_1, A_2);
                        }
                        else
                        {
                            new Class338(A_0);
                        }
                    }
                    else
                    {
                        if (A_2.ShapeType != ShapeType.OleObject)
                        {
                            A_2.SetShapeType(ShapeType.Image);
                        }
                        DocPicture imageData = A_2.ImageData;
                        Class798.smethod_0(A_0, A_1, A_2);
                    }
                }
                else if (A_0.method_55())
                {
                    class2.vmethod_1();
                }
                else
                {
                    A_0.method_56(true);
                    A_2.SetShapeType(ShapeType.TextBox);
                    naN = Class856.smethod_0(A_0, A_1, A_2);
                    A_0.method_56(false);
                }
                continue;
            }
Label_011A:
            class2.vmethod_1();
        }
        return(naN);
    }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Create a new Word document and add a new section
            Document doc     = new Document();
            Section  section = doc.AddSection();

            //Add a table with 3 columns and 3 rows
            Table table = section.AddTable(true);

            table.ResetCells(3, 3);

            //Merge rows
            table.ApplyVerticalMerge(0, 0, 2);

            //Set the vertical alignment for each cell, default is top
            table.Rows[0].Cells[0].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
            table.Rows[0].Cells[1].CellFormat.VerticalAlignment = VerticalAlignment.Top;
            table.Rows[0].Cells[2].CellFormat.VerticalAlignment = VerticalAlignment.Top;
            table.Rows[1].Cells[1].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
            table.Rows[1].Cells[2].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
            table.Rows[2].Cells[1].CellFormat.VerticalAlignment = VerticalAlignment.Bottom;
            table.Rows[2].Cells[2].CellFormat.VerticalAlignment = VerticalAlignment.Bottom;

            //Inset a picture into the table cell
            Paragraph  paraPic = table.Rows[0].Cells[0].AddParagraph();
            DocPicture pic     = paraPic.AppendPicture(Image.FromFile(@"..\..\..\..\..\..\Data\E-iceblue.png"));

            //Create data
            String[][] data =
            {
                new string[] { "", "Spire.Office", "Spire.DataExport" },
                new string[] { "", "Spire.Doc",    "Spire.DocViewer"  },
                new string[] { "", "Spire.XLS",    "Spire.PDF"        }
            };

            //Append data to table
            for (int r = 0; r < 3; r++)
            {
                TableRow dataRow = table.Rows[r];
                dataRow.Height = 50;
                for (int c = 0; c < 3; c++)
                {
                    if (c == 1)
                    {
                        Paragraph par = dataRow.Cells[c].AddParagraph();
                        par.AppendText(data[r][c]);
                        dataRow.Cells[c].Width = (section.PageSetup.ClientWidth) / 2;
                    }
                    if (c == 2)
                    {
                        Paragraph par = dataRow.Cells[c].AddParagraph();
                        par.AppendText(data[r][c]);
                        dataRow.Cells[c].Width = (section.PageSetup.ClientWidth) / 2;
                    }
                }
            }

            //Save and launch document
            string output = "SetVerticalAlignment.docx";

            doc.SaveToFile(output, FileFormat.Docx);
            Viewer(output);
        }
Ejemplo n.º 4
0
    internal VisitorAction method_0(Field A_0)
    {
        int        num     = 0x13;
        FieldType  type    = A_0.Type;
        Class44    class2  = A_0.Range;
        TextRange  range   = null;
        DocPicture picture = null;

        foreach (DocumentObject obj2 in class2)
        {
            if (obj2 is ParagraphBase)
            {
                (obj2 as ParagraphBase).SkipDocxItem = true;
            }
            if (obj2 is TextRange)
            {
                range = obj2 as TextRange;
            }
            if (obj2 is DocPicture)
            {
                picture = obj2 as DocPicture;
            }
        }
        if (((range != null) && (type == FieldType.FieldHyperlink)) && (this.class422_0.method_23() == OpenDocumentWritingStage.ContentAutomaticStyles))
        {
            this.class422_0.vmethod_16(range);
        }
        if (((picture != null) && (type == FieldType.FieldHyperlink)) && (this.class422_0.method_23() == OpenDocumentWritingStage.ContentAutomaticStyles))
        {
            this.class422_0.vmethod_34(picture);
        }
        if ((range != null) && (type != FieldType.FieldHyperlink))
        {
            this.class422_0.vmethod_16(range);
        }
        Class400 class3 = this.class422_0.method_18();
        Class974 class4 = new Class974(this.class422_0);

        if (this.class422_0.method_21())
        {
            switch (type)
            {
            case FieldType.FieldCreateDate:
            case FieldType.FieldSaveDate:
            case FieldType.FieldPrintDate:
            case FieldType.FieldDate:
            {
                string str2 = smethod_1(A_0.FormattingString);
                class4.method_14(str2, A_0);
                break;
            }
            }
        }
        else if ((this.class422_0.method_23() == OpenDocumentWritingStage.ContentBody) || this.class422_0.method_22())
        {
            switch (type)
            {
            case FieldType.FieldTitle:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀㝂ⱄ㍆╈⹊", num));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ㽆ⱈ⽊", num), BookmarkStart.b("弸娺儼䰾⑀", num));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldSubject:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀あい╆⍈⹊⹌㭎", num));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ㽆ⱈ⽊", num), BookmarkStart.b("弸娺儼䰾⑀", num));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldAuthor:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀⩂⭄⹆㵈≊ⱌ⍎籐げ❔㉖㡘⽚㉜ⵞ", num));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ㽆ⱈ⽊", num), BookmarkStart.b("弸娺儼䰾⑀", num));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldKeyWord:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀⡂⁄㹆㹈⑊㽌⭎≐", num));
                class3.method_18(BookmarkStart.b("䨸伺䐼匾⑀祂⭄㉆⑈晊⭌⁎⍐㹒㑔⍖", num), Class576.smethod_18(smethod_0(A_0.method_177()).Replace(BookmarkStart.b("爸縺搼栾เᅂńᑆ", num), "").Replace(BookmarkStart.b("攸ᄺ", num), "").Trim()));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldLastSavedBy:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀⁂㝄≆⡈㽊≌㵎", num));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldCreateDate:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀⁂㝄≆⡈㽊⑌⁎㽐繒ㅔ㙖ⵘ㹚", num));
                if (smethod_1(A_0.FormattingString) != "")
                {
                    class3.method_18(BookmarkStart.b("䨸伺䐼匾⑀祂⅄♆㵈⩊恌㱎═⩒㥔㉖瑘㕚㱜㉞Ѡ", num), class4.method_31());
                }
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldSaveDate:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀⹂⩄⍆⁈ⵊ⑌ⱎぐ❒㱔㡖㝘癚㥜㹞ᕠ٢", num));
                if (smethod_1(A_0.FormattingString) != "")
                {
                    class3.method_18(BookmarkStart.b("䨸伺䐼匾⑀祂⅄♆㵈⩊恌㱎═⩒㥔㉖瑘㕚㱜㉞Ѡ", num), class4.method_31());
                }
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldPrintDate:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀㍂㝄⹆❈㽊恌⭎ぐ❒ご", num));
                if (smethod_1(A_0.FormattingString) != "")
                {
                    class3.method_18(BookmarkStart.b("䨸伺䐼匾⑀祂⅄♆㵈⩊恌㱎═⩒㥔㉖瑘㕚㱜㉞Ѡ", num), class4.method_31());
                }
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldRevisionNum:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀♂⅄⹆㵈≊⍌⡎籐げⱔ㑖㕘㹚⹜", num));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ㽆ⱈ⽊", num), BookmarkStart.b("弸娺儼䰾⑀", num));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldEditTime:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀♂⅄⹆㵈≊⍌⡎籐㝒⁔╖㡘⽚㑜ぞའ", num));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ㽆ⱈ⽊", num), BookmarkStart.b("弸娺儼䰾⑀", num));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldNumPages:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀㍂⑄⁆ⱈ晊⹌⁎⑐㵒⅔", num));
                class3.method_18(BookmarkStart.b("䨸伺䐼匾⑀祂⭄㉆⑈晊⭌⁎⍐㹒㑔⍖", num), Class576.smethod_18(smethod_0(A_0.method_177()).Replace(BookmarkStart.b("眸渺瀼漾@тDᑆ", num), "").Replace(BookmarkStart.b("攸ᄺ", num), "").Trim()));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ㽆ⱈ⽊", num), BookmarkStart.b("弸娺儼䰾⑀", num));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldNumWords:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀㑂⩄㕆ⵈ晊⹌⁎⑐㵒⅔", num));
                class3.method_18(BookmarkStart.b("䨸伺䐼匾⑀祂⭄㉆⑈晊⭌⁎⍐㹒㑔⍖", num), Class576.smethod_18(smethod_0(A_0.method_177()).Replace(BookmarkStart.b("眸渺瀼栾เᅂńᑆ", num), "").Replace(BookmarkStart.b("攸ᄺ", num), "").Trim()));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldFileName:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ⭆ⱈ晊⍌⹎㱐㙒", num));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ㽆ⱈ⽊", num), BookmarkStart.b("弸娺儼䰾⑀", num));
                if (A_0.method_177().Trim().ToLower().EndsWith(BookmarkStart.b("攸䬺", num)))
                {
                    class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀❂ⱄ㑆㥈❊ⱌ㙎", num), BookmarkStart.b("弸为儼匾", num));
                }
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldTemplate:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀㝂⁄⩆㥈❊ⱌ㭎㑐繒㭔㙖㑘㹚", num));
                if (A_0.method_177().Trim().ToLower().EndsWith(BookmarkStart.b("攸䬺", num)))
                {
                    class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀❂ⱄ㑆㥈❊ⱌ㙎", num), BookmarkStart.b("弸为儼匾", num));
                }
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldDate:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀❂⑄㍆ⱈ", num));
                if (smethod_1(A_0.FormattingString) != "")
                {
                    class3.method_18(BookmarkStart.b("䨸伺䐼匾⑀祂⅄♆㵈⩊恌㱎═⩒㥔㉖瑘㕚㱜㉞Ѡ", num), class4.method_31());
                }
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldPage:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀㍂⑄⁆ⱈ晊⍌㩎㱐ㅒご╖", num));
                class3.method_18(BookmarkStart.b("䨸伺䐼匾⑀祂⭄㉆⑈晊⭌⁎⍐㹒㑔⍖", num), Class576.smethod_18(smethod_0(A_0.method_177()).Replace(BookmarkStart.b("椸稺稼稾", num), "").Replace(BookmarkStart.b("攸ᄺ", num), "").Trim()));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀╂ⱄ㽆ⱈ⽊", num), BookmarkStart.b("弸娺儼䰾⑀", num));
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldMergeField:
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀❂⑄㍆⡈⥊ⱌ㱎㑐繒ㅔ㹖⩘⭚ㅜ㹞ᡠ", num));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀㝂⑄╆╈⹊恌ⅎぐ㹒ご", num), "");
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀㝂⑄╆╈⹊恌㭎⡐⍒ご", num), BookmarkStart.b("䴸娺弼匾⑀", num));
                class3.method_18(BookmarkStart.b("䴸帺䔼䬾筀⁂⩄⭆㱈♊⍌扎㽐㉒㡔㉖", num), smethod_0(A_0.method_177()).Replace(BookmarkStart.b("琸縺漼砾рՂౄɆՈཊ", num), "").Trim());
                class3.method_15(A_0.Text);
                this.class422_0.method_18().method_5();
                break;

            case FieldType.FieldHyperlink:
                string str;
                class3.method_4(BookmarkStart.b("䴸帺䔼䬾筀≂", num));
                if ((A_0.Code == "") && (A_0.Value != null))
                {
                    str = string.Format(BookmarkStart.b("ᨸ䀺഼䈾", num), A_0.Value);
                }
                else
                {
                    str = smethod_0(A_0.method_177()).Replace(BookmarkStart.b("焸戺洼稾ፀགౄॆɈ", num), "").Trim();
                }
                class3.method_18(BookmarkStart.b("䄸场吼儾⩀祂ⵄ㕆ⱈⵊ", num), str.Replace(BookmarkStart.b("ᬸ", num), ""));
                class3.method_18(BookmarkStart.b("嘸崺嬼嘾≀♂罄㍆⡈㥊⩌⩎═繒㍔╖㡘㙚㡜牞འɢࡤɦ", num), BookmarkStart.b("昸伺刼伾", num));
                class3.method_18(BookmarkStart.b("䄸场吼儾⩀祂㙄⽆♈㱊", num), BookmarkStart.b("䬸帺䴼匾⁀⁂⁄", num));
                if (range != null)
                {
                    range.SkipDocxItem = false;
                    this.class422_0.vmethod_16(range);
                    range.SkipDocxItem = true;
                }
                if (picture != null)
                {
                    picture.SkipDocxItem = false;
                    this.class422_0.vmethod_34(picture);
                    this.class422_0.vmethod_35(picture);
                    picture.SkipDocxItem = true;
                }
                class3.method_15(A_0.Text);
                this.class422_0.method_18().method_5();
                break;

            default:
                if (range != null)
                {
                    class3.method_15(range.Text);
                }
                break;
            }
            if (((range != null) && (range.Text.Length > 0)) && (type != FieldType.FieldHyperlink))
            {
                this.class422_0.method_18().method_67(BookmarkStart.b("䴸帺䔼䬾筀あ㕄♆❈", num));
            }
        }
        return(VisitorAction.Continue);
    }
Ejemplo n.º 5
0
        internal DocPicture method_63(bool A_0)
        {
            Paragraph owner = base.Owner as Paragraph;

            owner = (owner != null) ? owner : base.method_28();
            Document document      = base.Document;
            float    heightPercent = this.HeightPercent;

            if (this.HeightPercent > 0f)
            {
                float num = this.method_67(base.RelativeHeight, this.HeightPercent);
                if ((num > 0f) && (base.Height != num))
                {
                    base.Height = num;
                }
            }
            float widthPercent = this.WidthPercent;

            if (this.WidthPercent > 0f)
            {
                float num2 = this.method_68(base.RelativeWidth, this.WidthPercent);
                if ((num2 > 0f) && (num2 != base.Width))
                {
                    base.Width = num2;
                }
            }
            if ((base.LeftPercent != null) && (((float)base.LeftPercent) != 0f))
            {
                float num3 = this.method_65(this.HorizontalOrigin, (float)base.LeftPercent);
                if ((num3 != 0f) && (base.Left != num3))
                {
                    base.Left = num3;
                }
            }
            if ((base.TopPercent != null) && (((float)base.TopPercent) != 0f))
            {
                float num4 = this.method_66(this.VerticalOrigin, (float)base.TopPercent);
                if ((num4 != 0f) && (base.Top != num4))
                {
                    base.Top = num4;
                }
            }
            if (!A_0 && !this.CompleteExtractionOfEmbeddedTextbox)
            {
                int num5 = this.method_64(this, this, owner);
                int num6 = num5;
                this.method_70(owner, this, ref num5);
                this.CompleteExtractionOfEmbeddedTextbox = true;
                if (num6 != num5)
                {
                    document.LayoutVariables.method_0().Add(owner);
                }
            }
            DocPicture picture = new DocPicture(base.Document, base.Clone() as ShapeObject)
            {
                ShapeInfo = this
            };

            picture.method_0(base.Owner);
            picture.Height             = (float)base.Height;
            picture.Width              = (float)base.Width;
            picture.HorizontalPosition = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (((float)base.Left) / 20f) : ((float)base.Left);
            picture.VerticalPosition   = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (((float)base.Top) / 20f) : ((float)base.Top);
            if (base.IsHorizontalRule)
            {
                DocumentObject obj2 = base.Owner;
                while (obj2 != null)
                {
                    if (obj2 is Section)
                    {
                        break;
                    }
                    obj2 = obj2.Owner;
                }
                if (obj2 is Section)
                {
                    float clientWidth = (obj2 as Section).PageSetup.ClientWidth;
                    if (this.HorizontalRule.method_8() > 0.0)
                    {
                        float num8 = (float)((clientWidth * this.HorizontalRule.method_8()) / 100.0);
                        picture.Width = num8;
                        base.Width    = num8;
                    }
                    switch (this.HorizontalRule.method_6())
                    {
                    case ShapeHorizontalAlignment.Center:
                        picture.HorizontalPosition = (clientWidth - picture.Width) / 2f;
                        break;

                    case ShapeHorizontalAlignment.Right:
                        picture.HorizontalPosition = picture.Width - clientWidth;
                        break;
                    }
                }
            }
            picture.TextWrappingStyle   = this.TextWrappingStyleEx;
            picture.OwnerHyperlinkField = this.OwnerHyperlinkField;
            return(picture);
        }
Ejemplo n.º 6
0
        static void Main (string[] args) {
            Document exemploDoc = new Document ();
            #region criacao de documento
            //cria um documento com o nome exemploDoc//
            Section secaoCapa = exemploDoc.AddSection ();

            #endregion

            #region criar paragrafo
            //criar um paragrafo com o nome titulo e adiciona a secao secaoCap//
            //os paragrafos sao necessarios para inserçao de texto, imagens, tabelas, etc//
            Paragraph titulo = secaoCapa.AddParagraph ();
            #endregion

            #region adicionar um texto ao paragrafo
            //Adicionar o texto exemplos de titulos ao paragrafo titulo
            titulo.AppendText ("Exemolo de Titulo\n\n");

            #endregion

            #region formatar paragrafo
            titulo.Format.HorizontalAlignment = HorizontalAlignment.Center;

            ParagraphStyle estilo01 = new ParagraphStyle (exemploDoc);

            //Adiciona um nome ao estilo01//
            estilo01.Name = "cor do Titulo";

            //definir cor do titulo
            estilo01.CharacterFormat.TextColor = Color.DarkRed;

            //define que o texto será em negrito
            estilo01.CharacterFormat.Bold = true;

            //adiciona o estilo01 ao documento exemploDoc
            exemploDoc.Styles.Add (estilo01);

            //aplica o estilo01 ao paragrafo titulo
            titulo.ApplyStyle (estilo01.Name);
            #endregion

            #region Trabalhar com Tabulação

            //adiciona um paragrafo textoCapa a seção secaoCapa
            Paragraph TextoCapa = secaoCapa.AddParagraph ();

            //adiciona um testo ao paragrafo com tabulação
            TextoCapa.AppendText ("\tEate é um exemplo de texto com t.");

            //adicionar um novo paragrafo a mesma seção (secaoCapa)
            Paragraph textoCapa2 = secaoCapa.AddParagraph ();

            //adicionar um texto ao paragrafo textocapa2 com concatenação
            textoCapa2.AppendText ("\tBasicamente, então, uma seção representa uma pagina do documento e os paragrafos dentro de uma seção " + " obviamente, aparecem na mesma pagina");

            #endregion 

            #region inserir imagens
            Paragraph imagemCapa = secaoCapa.AddParagraph ();
            //adiciona um texto ao paragrafo imagemCapa
            imagemCapa.AppendText ("\n\n\tAgora vamos enserir uma imagem ao documento\n\n");

            imagemCapa.Format.HorizontalAlignment = HorizontalAlignment.Center;

            DocPicture imagemExemplo = imagemCapa.AppendPicture(Image.FromFile (@"saida\imglogo_csharp.png"));
                
            //define uma largura e uma altura para a imagem 
            imagemExemplo.Width = 300;
            imagemExemplo.Height = 300;
            #endregion

            #region Adicionar nova seção
            //Adicionar uma nova seção
            Section secaoCorpo = exemploDoc.AddSection ();

            Paragraph paragrafoCorpo1 = secaoCorpo.AddParagraph ();

            paragrafoCorpo1.AppendText ("\tEste é um exemplo de paragrafo criado em uma seção, " + " \tComo foio criada uma nova seção, perceba que este texto aparece em uma nova pagina,");

            #endregion

            #region Adicionar uma tabela
            //Adicionar o cabeçalho da tabela
            Table tabela = secaoCorpo.AddTable (true);

            // cria o cabeçalho da tabela
            string[] cabeçalho = { "Item", "Descrição", "Qtd", "Preço Unit.", "Preço" };

            String[][] dados = {
                new String[] { "Cenoura", "Vegetal muito nutritivo", "1", "R$ 4,00", "R$ 4,00" },
                new String[] { "Batata", "Vegetal muito nutritivo", "2", "R$ 5,00", "R$ 10,00" },
                new String[] { "Alface", "Vegetal muito nutritivo", "1", "R$ 1,50", "R$ 1,50" },
                new String[] { "Tomate", "Vegetal muito nutritivo", "1", "R$ 12,00", "R$ 12,00" }
            };

            //Adiciona as celulas na tabela
            tabela.ResetCells (dados.Length + 1, cabeçalho.Length);

            //adiciona uma linha na posição [0] do vetor de linhas
            //e define que esta linha é o cabeçalho
            TableRow Linha1 = tabela.Rows[0];
            Linha1.IsHeader = true;

            //define a altura da linha 
            Linha1.Height = 23;

            //Formatação do cabeçalho
            Linha1.RowFormat.BackColor = Color.AliceBlue;

            //percorre as colunas do cabeçalho
            for (int i = 0; i < cabeçalho.Length; i++) {
                Paragraph p = Linha1.Cells[i].AddParagraph ();
                Linha1.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                //Formatação dos dados do cabeçalho
                TextRange TR = p.AppendText (cabeçalho[i]);
                TR.CharacterFormat.FontName = (cabeçalho[i]);
                TR.CharacterFormat.FontSize = 14;
                TR.CharacterFormat.TextColor = Color.Teal;
                TR.CharacterFormat.Bold = true;

                //adiciona as linhas do corpo da tabela
                for (int r = 0; r < dados.Length; r++) {
                    TableRow LinhaDados = tabela.Rows[r + 1];

                    //define a altura da linha 
                    LinhaDados.Height = 20;

                    for (int c = 0; c < dados[r].Length; c++) {
                        //alinha as celulas
                        LinhaDados.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                        //preenche os dados nas linhas
                        Paragraph p2 = LinhaDados.Cells[c].AddParagraph ();

                        TextRange TR2 = p2.AppendText (dados[r][c]);

                        //formata as celulas 
                        p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                        TR2.CharacterFormat.FontName = "calibri";
                        TR2.CharacterFormat.FontSize = 12;
                        TR2.CharacterFormat.TextColor = Color.Brown;
                    }
                }

                #endregion

                #region salvar arquivo
                
                //salvar um arquivo em .Docx
                //assim como np word, caso ja exista um arquivo com este nome, é substituida
                //ultilozar o metodo SaveToFile para salvar o arquivo no formato desejado 
                exemploDoc.SaveToFile (@"saida\exemplo_arquivo_word.docx", FileFormat.Docx);

            }
        }
Ejemplo n.º 7
0
        public IActionResult Batchs(string command, string ids)
        {
            var          response       = ResponseModelFactory.CreateInstance;
            string       sWebRootFolder = _hostingEnvironment.WebRootPath + "\\UploadFiles\\ImportUserInfoWord\\";
            var          timeInfo       = DateTime.Now.ToString("yyyyMMddHHmmss");
            var          wordName       = timeInfo + "address.docx";
            string       wordUrl        = sWebRootFolder + wordName;
            MemoryStream ms             = new MemoryStream();
            XWPFDocument m_Docx         = new XWPFDocument();

            m_Docx.Write(ms);
            ms.Flush();
            SaveToFile(ms, wordUrl);
            List <string> list = new List <string>();


            using (_dbContext)
            {
                //document111.LoadFromFile(sWebRootFolder + "test.docx");
                Document document111 = new Document();
                document111.LoadFromFile(wordUrl);
                Section section = document111.Sections[0];
                document111.Watermark = null;
                section.Paragraphs[0].AppendBookmarkStart("picture");
                section.Paragraphs[0].AppendBookmarkEnd("picture");
                var parameters     = ids.Split(",").Select((id, index) => new SqlParameter(string.Format("@p{0}", index), id)).ToList();
                var parameterNames = string.Join(", ", parameters.Select(p => p.ParameterName));
                var entities       = _dbContext.SystemUser.Where(x => ids.IndexOf(x.SystemUserUuid.ToString()) >= 0).ToList();
                for (int i = 0; i < entities.Count; i++)
                {
                    var pata = _hostingEnvironment.WebRootPath + EWM.GetEWM2("d_" + entities[i].SystemUserUuid.ToString(), _hostingEnvironment, entities[i].RealName);
                    //实例化BookmarksNavigator类,指定需要添加图片的书签“”
                    BookmarksNavigator bn = new BookmarksNavigator(document111);
                    bn.MoveToBookmark("picture", true, true);
                    //添加段落,加载图片并插入到段落
                    Section section0 = document111.AddSection();
                    Spire.Doc.Documents.Paragraph paragraph = section0.AddParagraph();
                    Image image = Image.FromFile(pata);

                    //DocPicture picture = paragraph.AppendPicture(image);
                    DocPicture picture = document111.Sections[0].Paragraphs[0].AppendPicture(image);
                    picture.Width  = 160;
                    picture.Height = 180;
                    //picture.HorizontalPosition = 100.0f;
                    //picture.VerticalPosition = 100.0f;
                    bn.InsertParagraph(paragraph);
                    document111.Sections.Remove(section0);
                    //string output = sWebRootFolder + "test.docx";
                    document111.SaveToFile(wordUrl, FileFormat.Docx);
                }
                list.Add(wordUrl);
                //关闭进程
                document111.Dispose();
                var time  = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                var check = ZIP.CompressMulti(list, _hostingEnvironment.WebRootPath + "\\UploadFiles\\EWM\\" + time, false);
                if (check)
                {
                    response.SetSuccess("导出成功");
                    response.SetData("\\UploadFiles\\EWM\\" + time + ".zip");
                }
                else
                {
                    response.SetFailed("导出失败");
                }
                return(Ok(response));
            }
        }
Ejemplo n.º 8
0
        internal void method_8()
        {
            TextRange           range;
            SdtDropDownListBase controlProperties;

            switch (this.SDTType)
            {
            case SdtType.ComboBox:
            case SdtType.DropDownList:
            {
                controlProperties = this.ControlProperties as SdtDropDownListBase;
                range             = null;
                if (!(this.documentObject_0 is StructureDocumentTagCell))
                {
                    if (this.documentObject_0 is StructureDocumentTagInline)
                    {
                        StructureDocumentTagInline inline3 = this.documentObject_0 as StructureDocumentTagInline;
                        if (inline3.ChildObjects.Count > 0)
                        {
                            range = inline3.ChildObjects[0] as TextRange;
                        }
                    }
                    else if (this.documentObject_0 is StructureDocumentTag)
                    {
                        StructureDocumentTag tag = this.documentObject_0 as StructureDocumentTag;
                        if (((tag.ChildObjects.Count > 0) && (tag.ChildObjects[0] is Paragraph)) && ((tag.ChildObjects[0] as Paragraph).ChildObjects.Count > 0))
                        {
                            range = (tag.ChildObjects[0] as Paragraph).ChildObjects[0] as TextRange;
                        }
                    }
                    break;
                }
                StructureDocumentTagCell cell = this.documentObject_0 as StructureDocumentTagCell;
                if (((cell.ChildObjects.Count > 0) && (cell.ChildObjects[0] is Paragraph)) && ((cell.ChildObjects[0] as Paragraph).ChildObjects.Count > 0))
                {
                    range = (cell.ChildObjects[0] as Paragraph).ChildObjects[0] as TextRange;
                }
                break;
            }

            case SdtType.Picture:
            {
                SdtPicture picture = this.ControlProperties as SdtPicture;
                Image      image   = picture.Image;
                if (image != null)
                {
                    DocPicture picture2 = null;
                    if (this.documentObject_0 is StructureDocumentTagCell)
                    {
                        StructureDocumentTagCell cell2 = this.documentObject_0 as StructureDocumentTagCell;
                        if (((cell2.ChildObjects.Count > 0) && (cell2.ChildObjects[0] is Paragraph)) && ((cell2.ChildObjects[0] as Paragraph).ChildObjects.Count > 0))
                        {
                            picture2 = (cell2.ChildObjects[0] as Paragraph).ChildObjects[0] as DocPicture;
                        }
                    }
                    else if (this.documentObject_0 is StructureDocumentTagInline)
                    {
                        StructureDocumentTagInline inline = this.documentObject_0 as StructureDocumentTagInline;
                        if (inline.ChildObjects.Count > 0)
                        {
                            picture2 = inline.ChildObjects[0] as DocPicture;
                        }
                    }
                    else if (this.documentObject_0 is StructureDocumentTag)
                    {
                        StructureDocumentTag tag3 = this.documentObject_0 as StructureDocumentTag;
                        if (((tag3.ChildObjects.Count > 0) && (tag3.ChildObjects[0] is Paragraph)) && ((tag3.ChildObjects[0] as Paragraph).ChildObjects.Count > 0))
                        {
                            picture2 = (tag3.ChildObjects[0] as Paragraph).ChildObjects[0] as DocPicture;
                        }
                    }
                    if (picture2 != null)
                    {
                        picture2.method_89(image);
                        this.IsShowingPlaceHolder = false;
                        picture.Image             = null;
                    }
                }
                return;
            }

            case SdtType.CheckBox:
            {
                SdtCheckBox box    = this.ControlProperties as SdtCheckBox;
                TextRange   range2 = null;
                if (this.documentObject_0 is StructureDocumentTagCell)
                {
                    StructureDocumentTagCell cell3 = this.documentObject_0 as StructureDocumentTagCell;
                    if (((cell3.ChildObjects.Count > 0) && (cell3.ChildObjects[0] is Paragraph)) && ((cell3.ChildObjects[0] as Paragraph).ChildObjects.Count > 0))
                    {
                        range2 = (cell3.ChildObjects[0] as Paragraph).ChildObjects[0] as TextRange;
                    }
                }
                else if (this.documentObject_0 is StructureDocumentTagInline)
                {
                    StructureDocumentTagInline inline2 = this.documentObject_0 as StructureDocumentTagInline;
                    if (inline2.ChildObjects.Count > 0)
                    {
                        range2 = inline2.ChildObjects[0] as TextRange;
                    }
                }
                else if (this.documentObject_0 is StructureDocumentTag)
                {
                    StructureDocumentTag tag2 = this.documentObject_0 as StructureDocumentTag;
                    if (((tag2.ChildObjects.Count > 0) && (tag2.ChildObjects[0] is Paragraph)) && ((tag2.ChildObjects[0] as Paragraph).ChildObjects.Count > 0))
                    {
                        range2 = (tag2.ChildObjects[0] as Paragraph).ChildObjects[0] as TextRange;
                    }
                }
                if (range2 != null)
                {
                    if (box.Checked)
                    {
                        range2.Text = ((char)box.CheckedState.method_3()).ToString();
                        return;
                    }
                    range2.Text = ((char)box.UncheckedState.method_3()).ToString();
                }
                return;
            }

            default:
                return;
            }
            if ((range != null) && (controlProperties.ListItems.SelectedValue != null))
            {
                if (!this.IsShowingPlaceHolder)
                {
                    range.CharacterFormat.method_55(Color.Empty);
                    range.CharacterFormat.TextBackgroundColor = Color.Empty;
                }
                range.Text = controlProperties.ListItems.SelectedValue.DisplayText;
            }
        }
        static void Main(string[] args)
        {
            #region Criacao do documento
            // CTRL + .
            Document ExemploDoc = new Document();
            #endregion

            #region Criacao de secao no documento
            // Adiciona uma secao com o nome secao capa ao documento
            // Cada secao pode ser entendida como uma pagina do documento
            Section SecaoCapa = ExemploDoc.AddSection();
            #endregion

            #region Criar um paragrafo
            // Cria um paragrafo com o nome titulo e adiciona a secao secaocapa
            // Os paragrafos são necessários para inserção de textos, imagens, tabelass e etec
            Paragraph Titulo = SecaoCapa.AddParagraph();
            #endregion

            #region Adiciona o texto ao paragrafo
            // Adiciona o texto Exemplo de título ao paragrafo titulo
            Titulo.AppendText("Exemplo de título\n\n");
            #endregion

            #region Formatar paragrafo
            // Através da propriedade HorizontalAlignment, é possível alinhar o parágrafo
            Titulo.Format.HorizontalAlignment = HorizontalAlignment.Center;

            // Cria um estilo com o nome estilo01 e adiciona ao documento ExemploDoc
            ParagraphStyle Estilo1 = new ParagraphStyle(ExemploDoc);

            // Define um nome ao estilo01
            Estilo1.Name = "Cor do titulo";

            // Definir a cor do texto
            Estilo1.CharacterFormat.TextColor = Color.DarkBlue;

            //Define que o testo será em negrito
            Estilo1.CharacterFormat.Bold = true;

            // Adiciona o estilo01 ao documento exemploDoc
            ExemploDoc.Styles.Add(Estilo1);

            // Aplica o estilo01 ao paragrafo titulo
            //Titulo.ApplyStyle("Cor do titulo");
            Titulo.ApplyStyle(Estilo1.Name);
            #endregion

            #region Trabalhar com tabulacao
            // Adiciona  um paragrafo textocapa a secao secaocapa
            Paragraph TextoCapa = SecaoCapa.AddParagraph();

            //Adciona um texto ao paragrafo com tabulacao
            TextoCapa.AppendText("\t Este é um exemplo de texto com tabulação\n");

            // Adiciona um novo paragrafo a mesma secao (secaocapa)
            Paragraph TextoCapa2 = SecaoCapa.AddParagraph();


            TextoCapa2.AppendText("\t Basicamente, então, uma seção representa uma página do documento e os parágrafos dentro de uma mesma seção," + "Obviamente, aparecem na mesma página");
            #endregion

            #region Inserir Imagens
            // Adiciona um paragrafo a secaocapa
            Paragraph ImagemDaCapa = SecaoCapa.AddParagraph();

            // Adiciona um texto ao paragrafo imagemdacapa
            ImagemDaCapa.AppendText("\n\n\t Agora vamos inserir uma imagem o documento\n\n");

            // Centralizar horizontalmente o paragrafo imagemdacapa
            ImagemDaCapa.Format.HorizontalAlignment = HorizontalAlignment.Center;

            // Adiciona uma imagem com o nome imagemExemplo ao parágrafo imagemDaCapa
            DocPicture ImagemExemplo = ImagemDaCapa.AppendPicture(Image.FromFile(@"saida\img\logo_csharp.png"));

            //Define uma largura e uma altura para a imagem
            ImagemExemplo.Width  = 300;
            ImagemExemplo.Height = 300;
            #endregion

            #region Adicionar nova secao
            // Adiciona uma nova secao
            Section SecaoCorpo = ExemploDoc.AddSection();

            //Adiciona um parafrafo a secao  secaoCorpo
            Paragraph ParagrafoCorpo1 = SecaoCorpo.AddParagraph();

            // Adiciona um texto ao paragrafo paragrafoCorpo1
            ParagrafoCorpo1.AppendText("\t Este é um exemplo de paragráfo criado em uma nova secao." + "Criada uma nova secao, perceba que este texto aparece em uma nova página");
            #endregion

            #region Adicionar uma tabela
            // Adiciona uma tabela a secao secaocorpo
            Table Tabela = SecaoCorpo.AddTable(true);

            // Cria o cabeçalho da tabela
            String[] Cabecalho = { "Item", "Descrição", "Quantidade", "Preço Unitário", "Preço" };

            String[][] Dados =
            {
                new String[] { "Cenoura",  "Vegetal muito Consumido", "1", "R$ 4,00", "R$ 4,00" },
                new String[] { "Batata",   "Vegetal muito Consumido", "2", "R$ 1,00", "R$ 1,00" },
                new String[] { "Alface",   "Vegetal muito Consumido", "3", "R$ 2,00", "R$ 2,00" },
                new String[] { "Brócolis", "Vegetal muito Consumido", "4", "R$ 3,00", "R$ 3,00" }
            };

            // Adiciona as celulas na tabela
            Tabela.ResetCells(Dados.Length + 1, Cabecalho.Length);

            // Adiciona uma linha na posicao [0] do vetor de linhas
            // E defino que esta linha é o cabecalho
            TableRow Linha1 = Tabela.Rows[0];
            Linha1.IsHeader = true;

            // Define a altura da linha
            Linha1.Height = 23;

            // Formatação do cabeçalho
            Linha1.RowFormat.BackColor = Color.AliceBlue;

            // Percorre as colunas do cabeçalho
            for (int i = 0; i < Cabecalho.Length; i++)
            {
                Paragraph P = Linha1.Cells[i].AddParagraph();
                Linha1.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                P.Format.HorizontalAlignment = HorizontalAlignment.Center;

                // Formataçãp dos dados do cabeçalho
                TextRange TR = P.AppendText(Cabecalho[i]);
                TR.CharacterFormat.FontName  = "Calibri";
                TR.CharacterFormat.FontSize  = 14;
                TR.CharacterFormat.TextColor = Color.Teal;
                TR.CharacterFormat.Bold      = true;
            }

            // Adiciona as linhas do corpo da tabela
            for (int r = 0; r < Dados.Length; r++)
            {
                TableRow LinhaDados = Tabela.Rows[r + 1];

                // Define a altura da linha
                LinhaDados.Height = 20;

                // Percorre as colunas
                for (int c = 0; c < Dados[r].Length; c++)
                {
                    // Alinha as Celulas
                    LinhaDados.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                    // Preenche os dados nas linhas
                    Paragraph P2 = LinhaDados.Cells[c].AddParagraph();

                    TextRange TR2 = P2.AppendText(Dados[r][c]);

                    // Formata as celulas
                    P2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                    TR2.CharacterFormat.FontName  = "Calibri";
                    TR2.CharacterFormat.FontSize  = 12;
                    TR2.CharacterFormat.TextColor = Color.Brown;
                }
            }

            #endregion

            #region Salvar Arquivo
            // Salvar o arquivo em .Docx
            // Utiliza o metodo SaveToFile para salcar o arquivo formatdo desejado
            // Assim como no word, caso ja exista um arquivo com este nome, é subtituido
            ExemploDoc.SaveToFile(@"saida\exemplo_arquivo_word.docx", FileFormat.Docx);
            #endregion
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            Document ex1 = new Document();

            Section s1 = ex1.AddSection();

            Paragraph title = s1.AddParagraph();

            title.AppendText("Exercício resolvido!\n\n");

            title.Format.HorizontalAlignment = HorizontalAlignment.Center;

            ParagraphStyle testilo = new ParagraphStyle(ex1);

            testilo.Name = "\tCor do tiulo";

            Paragraph title2 = s1.AddParagraph();

            title2.AppendText("\t\n\nTexto em negrito, sublinhado e italico, fonte arial 18\n\n");


            testilo.CharacterFormat.TextColor      = Color.Black;
            testilo.CharacterFormat.Bold           = true;
            testilo.CharacterFormat.Italic         = true;
            testilo.CharacterFormat.UnderlineStyle = UnderlineStyle.Single;
            testilo.CharacterFormat.FontSize       = 18;
            testilo.CharacterFormat.FontName       = "Arial";

            ex1.Styles.Add(testilo);

            testilo.Name = "Cor do titulo";


            title2.ApplyStyle(testilo.Name);



            Table tabela = s1.AddTable(true);

            String[]   header = { "Nome", "Descrição", "Nome vendedor(a)", "Preço" };
            String[][] data   =
            {
                new string[] { "Marmita 1", "Picadinho",         "Persona 1", "R$ 10,00" },
                new string[] { "Marmita 2", "Bife acebolado",    "Persona 2", "R$ 10,00" },
                new string[] { "Marmita 3", "Legumes refogados", "Persona 3", "R$ 12,00" }
            };

            tabela.ResetCells(data.Length + 1, header.Length);

            TableRow linha1 = tabela.Rows[0];

            linha1.IsHeader            = true;
            linha1.Height              = 23;
            linha1.RowFormat.BackColor = Color.AliceBlue;

            for (int i = 0; i < header.Length; i++)
            {
                Paragraph p = linha1.Cells[i].AddParagraph();
                linha1.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                TextRange TR = p.AppendText(header[i]);
                TR.CharacterFormat.FontName = "Arial";
                TR.CharacterFormat.FontSize = 14;
                TR.CharacterFormat.Bold     = true;
            }
            for (int r = 0; r < data.Length; r++)
            {
                TableRow linhaDados = tabela.Rows[r + 1];

                linhaDados.Height = 20;

                for (int c = 0; c < data.Length; c++)
                {
                    linhaDados.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                    Paragraph p2  = linhaDados.Cells[c].AddParagraph();
                    TextRange TR2 = p2.AppendText(data[r][c]);

                    p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                    TR2.CharacterFormat.FontName  = "Arial";
                    TR2.CharacterFormat.FontSize  = 12;
                    TR2.CharacterFormat.TextColor = Color.Red;
                }
            }

            Section   secaoImagem     = ex1.AddSection();
            Paragraph paragrafoImagem = secaoImagem.AddParagraph();

            paragrafoImagem.Format.HorizontalAlignment = HorizontalAlignment.Right;

            DocPicture imagemExemplo = paragrafoImagem.AppendPicture(Image.FromFile(@"saida\pinguins.jpeg"));

            imagemExemplo.Width  = 400;
            imagemExemplo.Height = 400;

            paragrafoImagem.AppendText("\t Pinguins dançantes!");

            ex1.SaveToFile(@"saida\Exercicio1.pdf", FileFormat.PDF);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 透過既有的套印檔匯出 Word 文件 (以「編輯書籤內容」方式套印)
        /// </summary>
        /// <param name="result">回傳: 執行結果</param>
        /// <param name="msg">回傳: 訊息</param>
        /// <returns>串流資訊</returns>
        public byte[] ExportResumeByDocx_Bookmark(out bool result, out string msg)
        {
            result = true;
            msg    = "";
            MemoryStream ms = new MemoryStream();

            try
            {
                Spire.Doc.Document document = new Spire.Doc.Document();

                //載入套印檔
                //注意: 實際運作時,若同一時間有兩位以上使用者同時進行套印,會產生「無法開啟已開啟檔案」的錯誤
                //建議實作時,一個使用者執行匯出動作時先複製一個套印檔,完成套印後再將複製的檔案刪除,即可避開錯誤
                document.LoadFromFile(HttpContext.Current.Server.MapPath("~/App_Data/MyResumeSample_Bookmark.docx"));

                #region 定義樣式

                //定義樣式 BasicStyle: 一般段落文字
                ParagraphStyle style = new ParagraphStyle(document)
                {
                    Name = "Basic"
                };
                //style.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Justify;
                style.CharacterFormat.FontName = "標楷體";
                style.CharacterFormat.FontSize = 12;
                document.Styles.Add(style);

                #endregion

                //取得要套印的內容
                Resume model = new Resume();

                #region 套印內容

                BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);

                Spire.Doc.Bookmark bookmark = document.Bookmarks.FindByName("NAME");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("NAME");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Name) ? "" : model.Name, false);
                }
                bookmark = document.Bookmarks.FindByName("GENDER");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("GENDER");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Gender) ? "" : model.Gender, false);
                }
                bookmark = document.Bookmarks.FindByName("EMAIL");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("EMAIL");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Email) ? "" : model.Email, false);
                }
                bookmark = document.Bookmarks.FindByName("ADDRESS");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("ADDRESS");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Address) ? "" : model.Address, false);
                }
                bookmark = document.Bookmarks.FindByName("PHONE");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("PHONE");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Phone) ? "" : model.Phone, false);
                }
                bookmark = document.Bookmarks.FindByName("MOBILE");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("MOBILE");
                    bookmarkNavigator.ReplaceBookmarkContent(string.IsNullOrEmpty(model.Mobile) ? "" : model.Mobile, false);
                }



                Spire.Doc.Section tempSection = document.AddSection();
                string            html;
                ParagraphBase     replacementFirstItem;
                ParagraphBase     replacementLastItem;
                TextBodySelection selection;
                TextBodyPart      part;

                //HTML Contents: Desciprion1
                bookmark = document.Bookmarks.FindByName("DESCRIPTION1");
                if (bookmark != null)
                {
                    html = string.IsNullOrEmpty(model.Description1) ? "" : HttpUtility.HtmlDecode(model.Description1);
                    tempSection.AddParagraph().AppendHTML(html);
                    replacementFirstItem = tempSection.Paragraphs[0].Items.FirstItem as ParagraphBase;
                    replacementLastItem  = tempSection.Paragraphs[tempSection.Paragraphs.Count - 1].Items.LastItem as ParagraphBase;
                    selection            = new TextBodySelection(replacementFirstItem, replacementLastItem);
                    //將內容各段落套用指定的樣式
                    for (int i = 0; i < tempSection.Paragraphs.Count; i++)
                    {
                        tempSection.Paragraphs[i].ApplyStyle("Basic");
                    }
                    part = new TextBodyPart(selection);

                    // locate the bookmark
                    bookmarkNavigator.MoveToBookmark("DESCRIPTION1");
                    //replace the content of bookmark
                    bookmarkNavigator.ReplaceBookmarkContent(part);
                    //remove temp section
                    document.Sections.Remove(tempSection);
                }

                //HTML Contents: Desciprion2
                bookmark = document.Bookmarks.FindByName("DESCRIPTION2");
                if (bookmark != null)
                {
                    tempSection = document.AddSection();
                    html        = string.IsNullOrEmpty(model.Description2) ? "" : HttpUtility.HtmlDecode(model.Description2);
                    tempSection.AddParagraph().AppendHTML(html);
                    replacementFirstItem = tempSection.Paragraphs[0].Items.FirstItem as ParagraphBase;
                    replacementLastItem  = tempSection.Paragraphs[tempSection.Paragraphs.Count - 1].Items.LastItem as ParagraphBase;
                    selection            = new TextBodySelection(replacementFirstItem, replacementLastItem);
                    part = new TextBodyPart(selection);

                    bookmarkNavigator.MoveToBookmark("DESCRIPTION2");
                    bookmarkNavigator.ReplaceBookmarkContent(part);
                    document.Sections.Remove(tempSection);
                }

                //圖片
                bookmark = document.Bookmarks.FindByName("IMG");
                if (bookmark != null)
                {
                    bookmarkNavigator.MoveToBookmark("IMG");
                    Spire.Doc.Section             section_img   = document.AddSection();
                    Spire.Doc.Documents.Paragraph paragraph_img = section_img.AddParagraph();
                    Image      img     = Image.FromFile(HttpContext.Current.Server.MapPath("~/App_Data/Penguins.jpg"));
                    DocPicture picture = paragraph_img.AppendPicture(img);

                    bookmarkNavigator.InsertParagraph(paragraph_img);
                    document.Sections.Remove(section_img);
                }
                #endregion

                #region 動態新增表格

                if (model.JobHistory.Count > 0)
                {
                    Spire.Doc.Section s      = document.AddSection();
                    Spire.Doc.Table   table  = s.AddTable(true);
                    string[]          Header = { "序號", "任職公司", "職稱", "開始時間", "結束時間" };

                    //Add Cells
                    table.ResetCells(model.JobHistory.Count + 1, Header.Length);

                    //Header Row
                    TableRow FRow = table.Rows[0];
                    FRow.IsHeader = true;
                    for (int i = 0; i < Header.Length; i++)
                    {
                        Spire.Doc.Documents.Paragraph p = FRow.Cells[i].AddParagraph();
                        FRow.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                        p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                        TextRange TR = p.AppendText(Header[i]);
                        TR.CharacterFormat.Bold = true;
                    }

                    //Data Row
                    model.JobHistory = model.JobHistory.OrderBy(x => x.StartDT).ToList();
                    for (int r = 0; r < model.JobHistory.Count; r++)
                    {
                        TableRow DataRow = table.Rows[r + 1];
                        string[] data    = new string[] { (r + 1).ToString(), model.JobHistory[r].CompanyName, model.JobHistory[r].JobTitle, (model.JobHistory[r].StartDT.HasValue ? model.JobHistory[r].StartDT.Value.ToShortDateString() : ""), (model.JobHistory[r].EndDT.HasValue ? model.JobHistory[r].EndDT.Value.ToShortDateString() : "") };

                        //Columns.
                        for (int c = 0; c < data.Length; c++)
                        {
                            //Cell Alignment
                            DataRow.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                            //Fill Data in Rows
                            Spire.Doc.Documents.Paragraph p2 = DataRow.Cells[c].AddParagraph();
                            TextRange TR2 = p2.AppendText(data[c]);

                            //Format Cells
                            p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                        }
                    }

                    bookmarkNavigator.MoveToBookmark("TABLE");
                    bookmarkNavigator.InsertTable(table);
                }

                #endregion

                #region 套用樣式

                //套用文章段落樣式
                for (int s = 0; s < document.Sections.Count; s++)
                {
                    Spire.Doc.Section sections = document.Sections[s];
                    //套用文章段落樣式
                    for (int p = 0; p < sections.Paragraphs.Count; p++)
                    {
                        Spire.Doc.Documents.Paragraph pgh = sections.Paragraphs[p];
                        pgh.ApplyStyle("Basic");
                        pgh.Format.BeforeSpacing = 12;
                    }

                    //套用表格樣式
                    for (int t = 0; t < document.Sections[s].Tables.Count; t++)
                    {
                        Spire.Doc.Table table = (Spire.Doc.Table)document.Sections[s].Tables[t];
                        table.PreferredWidth            = new PreferredWidth(WidthType.Percentage, 100);
                        table.TableFormat.IsAutoResized = true;

                        //set table border
                        //table.TableFormat.Borders.Right.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Left.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Top.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Horizontal.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Vertical.BorderType = Spire.Doc.Documents.BorderStyle.Thick;

                        for (int tr = 0; tr < table.Rows.Count; tr++)
                        {
                            for (int td = 0; td < table.Rows[tr].Cells.Count; td++)
                            {
                                for (int t_ph = 0; t_ph < table.Rows[tr].Cells[td].Paragraphs.Count; t_ph++)
                                {
                                    table.Rows[tr].Cells[td].Paragraphs[t_ph].ApplyStyle("Basic");
                                }
                            }
                        }
                    }
                }

                #endregion

                //匯出
                document.SaveToStream(ms, FileFormat.Docx);
            }
            catch (Exception ex)
            {
                result = false;
                msg    = ex.Message;
            }

            if (result)
            {
                return(ms.ToArray());
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 透過既有的套印檔匯出 Word 文件 (以「取代文字」方式套印)
        /// </summary>
        /// <param name="result">回傳: 執行結果</param>
        /// <param name="msg">回傳: 訊息</param>
        /// <returns>串流資訊</returns>
        public byte[] ExportResumeByDocx_ReplaceText(out bool result, out string msg)
        {
            result = true;
            msg    = "";
            MemoryStream ms = new MemoryStream();

            try
            {
                Spire.Doc.Document document = new Spire.Doc.Document();

                //載入套印檔
                //注意: 實際運作時,若同一時間有兩位以上使用者同時進行套印,會產生「無法開啟已開啟檔案」的錯誤
                //建議實作時,一個使用者執行匯出動作時先複製一個套印檔,完成套印後再將複製的檔案刪除,即可避開錯誤
                document.LoadFromFile(HttpContext.Current.Server.MapPath("~/App_Data/MyResumeSample.docx"));

                #region 定義樣式

                //定義樣式 BasicStyle: 一般段落文字
                ParagraphStyle style = new ParagraphStyle(document)
                {
                    Name = "Basic"
                };
                //style.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Justify;
                style.CharacterFormat.FontName = "標楷體";
                style.CharacterFormat.FontSize = 12;
                document.Styles.Add(style);

                #endregion

                //取得要套印的內容
                Resume model = new Resume();

                #region 套印內容

                document.Replace("{$Name$}", string.IsNullOrEmpty(model.Name) ? "" : model.Name, false, true);
                document.Replace("{$Gender$}", string.IsNullOrEmpty(model.Gender) ? "" : model.Gender, false, true);
                document.Replace("{$Email$}", string.IsNullOrEmpty(model.Email) ? "" : model.Email, false, true);
                document.Replace("{$Address$}", string.IsNullOrEmpty(model.Address) ? "" : model.Address, false, true);
                document.Replace("{$Phone$}", string.IsNullOrEmpty(model.Phone) ? "" : model.Phone, false, true);
                document.Replace("{$Mobile$}", string.IsNullOrEmpty(model.Mobile) ? "" : model.Mobile, false, true);

                //包含 HTML 字串需放置在 paragraph 內,
                //因此套印檔中的 {$Description1$} 及 {$Description2$} 需透過「以 paragraph 取代文字」方式替代
                //Replace {$Description1$} with paragraph
                TextSelection selection = document.FindString("{$Description1$}", false, true);
                TextRange     range     = selection.GetAsOneRange();
                Spire.Doc.Documents.Paragraph paragraph = range.OwnerParagraph;
                paragraph.ApplyStyle("Basic");
                paragraph.Replace("{$Description1$}", "", false, false);
                paragraph.AppendHTML(string.IsNullOrEmpty(model.Description1) ? "" : HttpUtility.HtmlDecode(model.Description1));

                //Replace {$Description2$} with paragraph
                selection = document.FindString("{$Description2$}", false, true);
                range     = selection.GetAsOneRange();
                paragraph = range.OwnerParagraph;
                paragraph.ApplyStyle("Basic");
                paragraph.Replace("{$Description2$}", "", false, false);
                paragraph.AppendHTML(string.IsNullOrEmpty(model.Description2) ? "" : HttpUtility.HtmlDecode(model.Description2));

                //Replace {$Img$} with Image
                DocPicture pic = new DocPicture(document);
                pic.LoadImage(Image.FromFile(HttpContext.Current.Server.MapPath("~/App_Data/Penguins.jpg")));

                selection = document.FindString("{$Img$}", false, true);
                range     = selection.GetAsOneRange();
                range.OwnerParagraph.ChildObjects.Insert(0, pic);
                range.OwnerParagraph.ChildObjects.Remove(range);

                #endregion

                #region 動態新增表格

                if (model.JobHistory.Count > 0)
                {
                    Spire.Doc.Section s      = document.AddSection();
                    Spire.Doc.Table   table  = s.AddTable(true);
                    string[]          Header = { "序號", "任職公司", "職稱", "開始時間", "結束時間" };

                    //Add Cells
                    table.ResetCells(model.JobHistory.Count + 1, Header.Length);

                    //Header Row
                    TableRow FRow = table.Rows[0];
                    FRow.IsHeader = true;
                    for (int i = 0; i < Header.Length; i++)
                    {
                        Spire.Doc.Documents.Paragraph p = FRow.Cells[i].AddParagraph();
                        FRow.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                        p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                        TextRange TR = p.AppendText(Header[i]);
                        TR.CharacterFormat.Bold = true;
                    }

                    //Data Row
                    model.JobHistory = model.JobHistory.OrderBy(x => x.StartDT).ToList();
                    for (int r = 0; r < model.JobHistory.Count; r++)
                    {
                        TableRow DataRow = table.Rows[r + 1];
                        string[] data    = new string[] { (r + 1).ToString(), model.JobHistory[r].CompanyName, model.JobHistory[r].JobTitle, (model.JobHistory[r].StartDT.HasValue ? model.JobHistory[r].StartDT.Value.ToShortDateString() : ""), (model.JobHistory[r].EndDT.HasValue ? model.JobHistory[r].EndDT.Value.ToShortDateString() : "") };

                        //Columns.
                        for (int c = 0; c < data.Length; c++)
                        {
                            //Cell Alignment
                            DataRow.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                            //Fill Data in Rows
                            Spire.Doc.Documents.Paragraph p2 = DataRow.Cells[c].AddParagraph();
                            TextRange TR2 = p2.AppendText(data[c]);

                            //Format Cells
                            p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                        }
                    }

                    //Replace text with Table
                    TextSelection selectionTable = document.FindString("{$JobHistory$}", true, true);
                    TextRange     rangeTable     = selectionTable.GetAsOneRange();
                    Spire.Doc.Documents.Paragraph paragraphTable = rangeTable.OwnerParagraph;
                    Body body  = paragraphTable.OwnerTextBody;
                    int  index = body.ChildObjects.IndexOf(paragraphTable);
                    body.ChildObjects.Remove(paragraphTable);
                    body.ChildObjects.Insert(index, table);
                }

                #endregion

                #region 套用樣式

                //套用文章段落樣式
                for (int s = 0; s < document.Sections.Count; s++)
                {
                    Spire.Doc.Section section = document.Sections[s];
                    //套用文章段落樣式
                    for (int p = 0; p < section.Paragraphs.Count; p++)
                    {
                        Spire.Doc.Documents.Paragraph pgh = section.Paragraphs[p];
                        pgh.ApplyStyle("Basic");
                        pgh.Format.BeforeSpacing = 12;
                    }

                    //套用表格樣式
                    for (int t = 0; t < document.Sections[s].Tables.Count; t++)
                    {
                        Spire.Doc.Table table = (Spire.Doc.Table)document.Sections[s].Tables[t];
                        table.PreferredWidth            = new PreferredWidth(WidthType.Percentage, 100);
                        table.TableFormat.IsAutoResized = true;

                        //set table border
                        //table.TableFormat.Borders.Right.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Left.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Top.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Horizontal.BorderType = Spire.Doc.Documents.BorderStyle.Thick;
                        //table.TableFormat.Borders.Vertical.BorderType = Spire.Doc.Documents.BorderStyle.Thick;

                        for (int tr = 0; tr < table.Rows.Count; tr++)
                        {
                            for (int td = 0; td < table.Rows[tr].Cells.Count; td++)
                            {
                                for (int t_ph = 0; t_ph < table.Rows[tr].Cells[td].Paragraphs.Count; t_ph++)
                                {
                                    table.Rows[tr].Cells[td].Paragraphs[t_ph].ApplyStyle("Basic");
                                }
                            }
                        }
                    }
                }

                #endregion

                //匯出
                document.SaveToStream(ms, FileFormat.Docx);
            }
            catch (Exception ex)
            {
                result = false;
                msg    = ex.Message;
            }

            if (result)
            {
                return(ms.ToArray());
            }
            else
            {
                return(null);
            }
        }
        public IActionResult yjExportInfo(AddressRequestPayload payload)
        {
            var response = ResponseModelFactory.CreateInstance;

            string       sWebRootFolder = _hostingEnvironment.WebRootPath + "\\UploadFiles\\ImportUserInfoWord\\";
            var          timeInfo       = DateTime.Now.ToString("yyyyMMddHHmmss");
            var          wordName       = timeInfo + "address.docx";
            string       wordUrl        = sWebRootFolder + wordName;
            MemoryStream ms             = new MemoryStream();
            XWPFDocument m_Docx         = new XWPFDocument();

            m_Docx.Write(ms);
            ms.Flush();
            SaveToFile(ms, wordUrl);

            List <string> list = new List <string>();

            using (_dbContext)
            {
                Document document111 = new Document();
                document111.LoadFromFile(wordUrl);
                Section section = document111.Sections[0];
                section.Paragraphs[0].AppendBookmarkStart("picture");
                section.Paragraphs[0].AppendBookmarkEnd("picture");

                var      user = AuthContextService.CurrentUser;
                string   s1   = payload.Kw2;
                string[] s2   = s1.Split(" ");
                StringBuilder where = new StringBuilder();
                StringBuilder sql = new StringBuilder("SELECT * FROM HomeAddress HA ");
                for (int i = 0; i < s2.Length; i++)
                {
                    if (s2.Length > 0 && i == 0)
                    {
                        where.Append("WHERE ");
                    }
                    where.Append("HA.Address LIKE '%" + s2[i] + "%' ");
                    if (i >= 0 && i < s2.Length - 1)
                    {
                        where.Append(" AND ");
                    }
                }
                sql.Append(where);
                //var query = _dbContext.HomeAdd.FromSql(sql.ToString());
                var query = _dbContext.HomeAddress.FromSqlRaw(sql.ToString());
                if (!string.IsNullOrEmpty(payload.Kw))
                {
                    query = query.Where(x => x.Address.ToString().Contains(payload.Kw));
                }
                if (!string.IsNullOrEmpty(payload.Kw1))
                {
                    query = query.Where(x => x.Address.ToString().Contains(payload.Kw1));
                }
                var entities = query.ToList();
                //var entities = _dbContext.HomeAddress.Where(x => ids.IndexOf(x.HomeAddressUuid.ToString()) >= 0).ToList();
                for (int i = 0; i < entities.Count(); i++)
                {
                    var pata = _hostingEnvironment.WebRootPath + EWM.GetEWM2("h_" + entities[i].HomeAddressUuid.ToString(), _hostingEnvironment, entities[i].Address);
                    //实例化BookmarksNavigator类,指定需要添加图片的书签“”
                    BookmarksNavigator bn = new BookmarksNavigator(document111);
                    bn.MoveToBookmark("picture", true, true);
                    //添加段落,加载图片并插入到段落
                    Section section0 = document111.AddSection();
                    Spire.Doc.Documents.Paragraph paragraph = section0.AddParagraph();
                    Image      image   = Image.FromFile(pata);
                    DocPicture picture = document111.Sections[0].Paragraphs[0].AppendPicture(image);
                    picture.Width  = 160;
                    picture.Height = 180;
                    //picture.HorizontalPosition = 100.0f;
                    //picture.VerticalPosition = 50.0f;
                    bn.InsertParagraph(paragraph);
                    document111.Sections.Remove(section0);
                    //string output = sWebRootFolder + "test.docx";
                    document111.SaveToFile(wordUrl, FileFormat.Docx);
                    //Arraypata = pata.;
                    //list.Add(pata);
                }
                list.Add(wordUrl);
                //关闭进程
                document111.Dispose();
                var time  = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                var check = ZIP.CompressMulti(list, _hostingEnvironment.WebRootPath + "\\UploadFiles\\EWM\\" + time, false);
                if (check)
                {
                    response.SetSuccess("导出成功");
                    response.SetData("\\UploadFiles\\EWM\\" + time + ".zip");
                }
                else
                {
                    response.SetFailed("导出失败");
                }
            }
            return(Ok(response));
        }
Ejemplo n.º 14
0
    internal Class262(ShapeBase A_0) : this()
    {
        float num;

        if (A_0.IsHorizontalRule)
        {
            this.picfType_0    = PicfType.InlineEscher;
            this.picfSubType_0 = (A_0.ShapeType == ShapeType.Image) ? PicfSubType.InlineHorizontalRuleImage : PicfSubType.InlineHorizontalRuleShape;
            goto Label_00B9;
        }
        if (A_0.IsWordArt)
        {
            this.picfType_0    = PicfType.InlineEscher;
            this.picfSubType_0 = PicfSubType.InlineWordArt;
            goto Label_00B9;
        }
        ShapeType shapeType = A_0.ShapeType;

        if (shapeType == ShapeType.OleObject)
        {
            goto Label_00A9;
        }
        if (shapeType != ShapeType.Image)
        {
            if (shapeType == ShapeType.OleControl)
            {
                goto Label_00A9;
            }
            this.picfType_0    = PicfType.InlineEscher;
            this.picfSubType_0 = PicfSubType.InlineShape;
        }
        else
        {
            ShapeObject obj2 = (ShapeObject)A_0;
            this.picfType_0    = (!obj2.ImageData.IsLink || obj2.HasImageBytes) ? PicfType.InlineEscher : PicfType.IncludePicture;
            this.picfSubType_0 = PicfSubType.InlineImage8;
        }
        goto Label_00B9;
Label_00A9:
        this.picfType_0    = PicfType.InlineEscher;
        this.picfSubType_0 = PicfSubType.InlineOleObject;
Label_00B9:
        num = 1f;
        float num2 = 1f;

        if ((A_0.ShapeType == ShapeType.Image) || (A_0.ShapeType == ShapeType.OleObject))
        {
            DocPicture imageData = (A_0 as ShapeObject).ImageData;
            num  = imageData.WidthScale / 100f;
            num2 = imageData.HeightScale / 100f;
        }
        if (A_0.IsTopLevel)
        {
            this.int_13 = (int)Math.Round((double)((A_0.Width * num) * 20.0));
            this.int_14 = (int)Math.Round((double)((A_0.Height * num2) * 20.0));
        }
        else
        {
            this.int_13 = (int)Math.Round((double)(A_0.Width * num));
            this.int_14 = (int)Math.Round((double)(A_0.Height * num2));
        }
        Class43 shapePr = A_0.ShapePr;

        this.border_0 = A_0.ShapePr.method_58().Top;
        this.border_1 = A_0.ShapePr.method_58().Left;
        this.border_2 = A_0.ShapePr.method_58().Bottom;
        this.border_3 = A_0.ShapePr.method_58().Right;
        SizeF ef = smethod_0(A_0.Size, A_0.Rotation);

        this.int_24 = (int)Math.Round((double)((((double)ef.Width) / A_0.Width) * 1000.0));
        this.int_25 = (int)Math.Round((double)((((double)ef.Height) / A_0.Height) * 1000.0));
    }
Ejemplo n.º 15
0
        static void Main(string[] args)
        {
            #region Criação do documento
            //Cria um documento com o
            Document exemploDoc = new Document();
            #endregion

            #region Criação de secção no Documento
            //Adiciona uma seção com o nome secaoCapa ao documento
            //Cada seção pode ser entendida como uma pagina do documento
            Section secaoCapa = exemploDoc.AddSection();
            #endregion

            #region Criar um paragrafo
            //Cria um paragrafo com o nome titulo e adiciona á seção secaoCapa
            //Os paragrafos são necessarios para insenção de textos, imagens, tabela etc
            Paragraph titulo = secaoCapa.AddParagraph();
            #endregion

            #region Adiciona texto ao paragrafo
            //Adiciona o texto Exemplo de Titulo ao paragrafo titulo
            titulo.AppendText("Exemplo de titulo\n\n");
            #endregion

            #region Formatar paragrafo
            //Através da propriedade HorizontalAligment, é possivel alinhar o paragrafo
            titulo.Format.HorizontalAlignment = HorizontalAlignment.Center;
            ParagraphStyle estilo01 = new ParagraphStyle(exemploDoc);
            //Adiciona um nome ao estilo01
            estilo01.Name = "Cor do titulo";

            //Definir a cor do texto
            estilo01.CharacterFormat.TextColor = Color.DarkBlue;

            //Definir que o texto será em negrito
            estilo01.CharacterFormat.Bold = true;

            // Adiciona o estilo01 ao documento
            exemploDoc.Styles.Add(estilo01);

            //Aplica o estilo01 ao paragrafo titulo
            titulo.ApplyStyle(estilo01.Name);
            #endregion

            #region Trabalhar com tabulação
            //Adiciona um paragrafo
            Paragraph textoCapa = secaoCapa.AddParagraph();

            textoCapa.AppendText("\tEste é um exemplo de texto com tabulação\n");

            Paragraph texto2Capa = secaoCapa.AddParagraph();

            texto2Capa.AppendText("\tBasicamento, então, uma seção representa uma pagina do documento e os paragrafos dentro de uma mesma seção" + "obviamente, aprecem na mesma pagina");
            #endregion

            #region Inserir imagem
            //Adiciona um paragrafo a seção secaoCapa
            Paragraph imagemCapa = secaoCapa.AddParagraph();

            //
            imagemCapa.AppendText("\n\n\tAgora vamos inserir uma imagem ao documento\n\n");

            //Centraliza horizontalmente o paragrafo imagemCapa
            imagemCapa.Format.HorizontalAlignment = HorizontalAlignment.Center;

            //Adiciona imagem com o nome imagemExemplo ao paragrafo imagemCapa
            DocPicture imagemExemplo = imagemCapa.AppendPicture(Image.FromFile(@"saida\IMG\logo_csharp.png"));

            //Define uma largura e uma altura p a imagem

            imagemExemplo.Width  = 300;
            imagemExemplo.Height = 300;

            #endregion

            #region Adicionar nova seção
            Section secaoCorpo = exemploDoc.AddSection();

            // Adiciona um paragrafo á seção secaoCorpo
            Paragraph paragraphCorpo = secaoCorpo.AddParagraph();

            //Adiciona um texto ao paragrafo paragraCorpo
            paragraphCorpo.AppendText("\tEste é um exemplo de paragrafo criado em uma nova seção." + "\tComo foi criada  uma nova seção, percebe que este texto aparece em uma nova pagina");

            #endregion

            #region  Adiciona uma tabela

            //Adiciona uma tabela a seção secaoCorpo
            Table tabela = secaoCorpo.AddTable(true);

            //Cria o cabeçalho da tabela
            string[] cabecalho = { "Item", "Descrição ", "Qtd. ", "Preço Unit. ", "Preço" };

            string[][] dados =
            {
                new String[] { "Cenoura", "Vegetal muito nutritivo",         "1", "R$4,00", "R$ 4,00"  },
                new String[] { "Batata",  "Vegetal muito consumido",         "2", "R$5,00", "R$ 10,00" },
                new String[] { "Cenoura", "Vegetal utilizado desde 500 a.C", "1", "R$1,50", "R$ 1,50"  },
                new String[] { "Cenoura", "Tomate é uma fruta",              "2", "R$6,00", "R$ 12,00" },
            };

            //Adiciona as celulas
            tabela.ResetCells(dados.Length + 1, cabecalho.Length);

            //Adiciona uma linha na posição [0] do vetor de linhas
            //e define que esta linha é um cabeçalho
            TableRow Linha1 = tabela.Rows[0];
            Linha1.IsHeader = true;

            //Define a altura da linha
            Linha1.Height = 23;

            //Formatação do cabeçalho
            Linha1.RowFormat.BackColor = Color.AliceBlue;

            // Percorre as linhas do cabeçalho
            for (int i = 0; i < cabecalho.Length; i++)
            {
                Paragraph p = Linha1.Cells[i].AddParagraph();
                Linha1.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                //Formatar dados do cabeçalho
                TextRange TR = p.AppendText(cabecalho[i]);
                TR.CharacterFormat.FontName  = "Calibri";
                TR.CharacterFormat.FontSize  = 14;
                TR.CharacterFormat.TextColor = Color.Teal;
                TR.CharacterFormat.Bold      = true;
            }

            //Adiciona as linhas do corpo da tabela
            for (int r = 0; r < dados.Length; r++)
            {
                TableRow LinhaDados = tabela.Rows[r + 1];

                //Define a altura da Linha
                LinhaDados.Height = 28;

                //Percorre as colunas
                for (int c = 0; c < dados[r].Length; c++)
                {
                    //Alinha as colunas
                    LinhaDados.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                    //Preencher os dados nas linhas
                    Paragraph p2  = LinhaDados.Cells[c].AddParagraph();
                    TextRange TR2 = p2.AppendText(dados[r][c]);

                    //Formatar as celulas
                    p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                    TR2.CharacterFormat.FontName  = "Calibri";
                    TR2.CharacterFormat.FontSize  = 12;
                    TR2.CharacterFormat.TextColor = Color.Brown;
                }
            }
            #endregion

            #region Salvar arquivo
            //Salva o arquivo em Docx
            //Utiliza o metodo SaveToFile p salvar o arquivo no formato desejado
            //Assim como no word. caso já exista um arquivo com este nome, e substituido
            exemploDoc.SaveToFile(@"saida\exemplo_arquivo_word_docx", FileFormat.Docx);
            #endregion
        }
Ejemplo n.º 16
0
        private void method_4(DocumentObject A_0, string A_1)
        {
            int num = 12;

            if (A_0 != null)
            {
                ParagraphBase base2 = null;
                switch (this.SDTType)
                {
                case SdtType.Picture:
                {
                    base2 = new DocPicture(A_0.Document);
                    byte[] imageBytes = Convert.FromBase64String(A_1.Replace(BookmarkStart.b("㠱", num), string.Empty).Replace(BookmarkStart.b("㤱", num), string.Empty).Replace(BookmarkStart.b("㼱", num), string.Empty));
                    (base2 as DocPicture).LoadImage(imageBytes);
                    break;
                }

                case SdtType.Text:
                case SdtType.None:
                    base2 = new TextRange(A_0.Document);
                    (base2 as TextRange).Text = A_1;
                    break;

                case SdtType.DatePicker:
                {
                    DateTime time;
                    base2 = new TextRange(A_0.Document);
                    if (string.IsNullOrEmpty(A_1))
                    {
                        (base2 as TextRange).Text = A_1;
                        break;
                    }
                    string      dateFormat = (this.ControlProperties as SdtDate).DateFormat;
                    CultureInfo provider   = (this.ControlProperties as SdtDate).method_1();
                    if (!DateTime.TryParse(A_1, out time))
                    {
                        (base2 as TextRange).Text = A_1;
                        break;
                    }
                    A_1 = !string.IsNullOrEmpty(dateFormat) ? time.ToString(dateFormat, provider) : time.ToString();
                    (base2 as TextRange).Text = A_1;
                    break;
                }
                }
                if (base2 != null)
                {
                    if (A_0 is StructureDocumentTag)
                    {
                        StructureDocumentTag tag = A_0 as StructureDocumentTag;
                        if (tag.ChildObjects.Count > 0)
                        {
                            Paragraph paragraph2 = tag.ChildObjects[0] as Paragraph;
                            this.method_5(paragraph2, base2);
                        }
                    }
                    else if (A_0 is StructureDocumentTagInline)
                    {
                        StructureDocumentTagInline inline = A_0 as StructureDocumentTagInline;
                        if (inline.ChildObjects.Count > 0)
                        {
                            base2.CharacterFormat.method_27((inline.ChildObjects[0] as ParagraphBase).CharacterFormat);
                            if (!this.IsDataBindingOfCoreProperties && base2.CharacterFormat.HasValue(9))
                            {
                                base2.CharacterFormat.Remove(9);
                            }
                        }
                        inline.ChildObjects.Clear();
                        inline.ChildObjects.Add(base2);
                    }
                    else if (!(A_0 is StructureDocumentTagRow) && (A_0 is StructureDocumentTagCell))
                    {
                        StructureDocumentTagCell cell = A_0 as StructureDocumentTagCell;
                        if (cell.ChildObjects.Count > 0)
                        {
                            Paragraph paragraph = cell.ChildObjects[0] as Paragraph;
                            this.method_5(paragraph, base2);
                        }
                    }
                }
            }
        }
Ejemplo n.º 17
0
        static void Main(string[] args)
        {
            #region Criacao do documento

            //Cria um documento doc com o nome exemploDoc
            Document exemploDOc = new Document();

            #endregion

            #region  Criacao da secao no documento
            //Adiciona uma secao com o nome secao capa ao documento
            // Cada secao pode ser entendida como uma pagina do documento
            Section secaoCapa = exemploDOc.AddSection();
            #endregion

            #region Criar um paragrafo
            //Cria um paragrafo com o nome titulo e adiciona a secao secaoCapa
            //Os paragrafos sao necessarios para a insercao de textos, imagens, tabelas e etc
            Paragraph titulo = secaoCapa.AddParagraph();
            #endregion

            #region adiciona texto ao paragrafo

            //adiciona o texto exemplo de titulo ao paragrafo titulo
            titulo.AppendText("Exemplo de Titulo\n\n");

            #endregion

            #region Formatar paragrafo

            // Atraves da proprieda Horizontal e é possivel alinhas o paragrafo
            titulo.Format.HorizontalAlignment = HorizontalAlignment.Center;

            ParagraphStyle estilo01 = new ParagraphStyle(exemploDOc);

            // adiciona um nome ao estilo 01
            estilo01.Name = "Cor do titulo";

            //definir a cor do texto
            estilo01.CharacterFormat.TextColor = Color.DarkCyan;

            //define que o texto será em negrito
            estilo01.CharacterFormat.Bold = true;
            //adiciona estilo01 ao docuemnto exempodoc
            exemploDOc.Styles.Add(estilo01);
            //aplica o estilo01 ao paragrafo titulo
            titulo.ApplyStyle(estilo01.Name);

            #endregion

            #region trabalhar com tabulação
            //adiciona um paragrafo  textoCapa a secao SecaoCapa
            Paragraph textoCapa = secaoCapa.AddParagraph();
            // adiciona um texto ao paragrafo com tabulação
            textoCapa.AppendText("\tEste é um exemplo de txto com tabulação\n");

            Paragraph textoCapa2 = secaoCapa.AddParagraph();

            textoCapa2.AppendText("\t Basicamente, então, uma seção representa uma pagina do documento e os paragrafos de uma seção," + "obviamente, aparecem na mesma pagina\n");

            #endregion

            #region Inserir imagens
            //adiciona um paragrafo a secao secaoCapa
            Paragraph imagemCapa = secaoCapa.AddParagraph();
            //adiciona o texto
            imagemCapa.AppendText("\n\n\tAgora vamos inserir uma imagem no documento\n\n");

            imagemCapa.Format.HorizontalAlignment = HorizontalAlignment.Center;
            //adiciona uma imagem ao paragrafo do do
            DocPicture imagemExemplo = imagemCapa.AppendPicture(Image.FromFile(@"saida\logo_csharp.png"));

            //Ddefine uma largura e uma altura para a imagem
            imagemExemplo.Width  = 300;
            imagemExemplo.Height = 300;

            #endregion

            #region Adicionar nova secao
            // adiciona uma nova secao
            Section secaoCorpo = exemploDOc.AddSection();

            Paragraph paragrafoCorpo = secaoCorpo.AddParagraph();

            paragrafoCorpo.AppendText("\nEste é um exemplo de paragrafo criado em uma nova seção." + "\tComo foi criado uma nova secao perceba que este texto aparece em uma nova pagina.");

            #endregion

            #region Adicionar Tabela

            //Adiciona uma tabela a secao secaoCorpo
            Table tabela = secaoCorpo.AddTable(true);

            //Cria o cabeçalho da tabela
            String[]   cabecalho = { "item", "Descricao", "Qtd", "Preco", "Unit", "Preco" };
            string[][] dados     =
            {
                new string[] { "Cenoura", "Vegetal muito nutritivo", "1", "R$ 4,00", "R$ 4,00"  },
                new string[] { "Batata",  "Vegetal muito nutritivo", "1", "R$ 5,00", "R$ 10,00" },
                new string[] { "Alface",  "Vegetal muito nutritivo", "1", "R$ 1,50", "R$ 1,50"  },
                new string[] { "Tomate",  "Tomate é uma fruta",      "1", "R$ 6,00", "R$12,00"  }
            };

            //Adiona  as celulas na tabela
            tabela.ResetCells(dados.Length + 1, cabecalho.Length);

            //Adiciona uma linha na posicao [0] do vetor de linhas
            //E define que esta linnha e o cabecalho
            TableRow Linha1 = tabela.Rows[0];
            Linha1.IsHeader = true;

            //Define a altura da linnha
            Linha1.Height = 23;

            //Formataçaõ do cabecalho
            Linha1.RowFormat.BackColor = Color.MediumPurple;

            //percorre as colunas do cabecalho
            for (int i = 0; i < cabecalho.Length; i++)
            {
                Paragraph p = Linha1.Cells[i].AddParagraph();
                Linha1.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                //Formatação dos dados do cabeçalho
                TextRange TR = p.AppendText(cabecalho[i]);
                TR.CharacterFormat.FontName  = "Calibri";
                TR.CharacterFormat.FontSize  = 14;
                TR.CharacterFormat.TextColor = Color.Teal;
                TR.CharacterFormat.Bold      = true;
            }

            //Adiciona as linhas do corpo da tabela
            for (int r = 0; r < dados.Length; r++)
            {
                TableRow LinhaDados = tabela.Rows[r + 1];

                //Define a altura da linha
                LinhaDados.Height = 20;

                for (int c = 0; c < dados[r].Length; c++)
                {
                    //alinha as celulas
                    LinhaDados.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                    //Preencher os dados nas linhas
                    Paragraph p2 = LinhaDados.Cells[c].AddParagraph();

                    TextRange TR2 = p2.AppendText(dados[r][c]);

                    // formatar celulas
                    p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                    TR2.CharacterFormat.FontName  = "Calibri";
                    TR2.CharacterFormat.FontSize  = 12;
                    TR2.CharacterFormat.TextColor = Color.Brown;
                }
            }
            #endregion

            #region salvar arquivo

            //Salva o arquivo em .Docx
            //Utiliza o metodo SaveToFile para salvar  oarquivo no formato desejado
            //Assim como no word, caso ja exista um arquivo com este nome, é substituido
            exemploDOc.SaveToFile(@"saida\exemplo_arquivo_word.docx", FileFormat.Docx);

            #endregion
        }
Ejemplo n.º 18
0
        static void Main(string[] args)
        {
            #region CriacaoDoDocumento
            // Criando documento com nome "exemplo"
            Document exemplo = new Document();
            #endregion

            #region CriaçãoDeSecao
            // Adiciona uma secao com nome "secaoCapa", a secao pode ser entendida como uma pagina
            Section secaoCapa = exemplo.AddSection();
            #endregion

            #region CriarParagrafo
            // Cria paragrafo "titulo" e o adiciona na "secaoCapa"
            Paragraph titulo = secaoCapa.AddParagraph();
            #endregion

            #region AdicionadoTextoNoParagrafo
            titulo.AppendText("Titulo do Documento\n\a");
            #endregion

            #region FormatandoParagrafo
            // Formatando o paragrafo titulo, com alinhamento central
            titulo.Format.HorizontalAlignment = HorizontalAlignment.Center;

            // Cria um estilo de formatação e adiciona ao documento
            ParagraphStyle estilo1 = new ParagraphStyle(exemplo);

            // Define o nome do estilo
            estilo1.Name = "Cor do Título";

            // Define a cor do titulo
            estilo1.CharacterFormat.TextColor = Color.Red;

            // Define Bold no estilo1
            estilo1.CharacterFormat.Bold = true;

            // Adiciona o estilo ao documento
            exemplo.Styles.Add(estilo1);

            // Aplica o estilo ao paragrafo
            titulo.ApplyStyle(estilo1.Name);
            #endregion

            #region Tabulação
            Paragraph textoDaCapa = secaoCapa.AddParagraph();
            textoDaCapa.AppendText("\tParagrafo Tabulado\n\a");

            Paragraph outroTexto = secaoCapa.AddParagraph();
            outroTexto.AppendText("\tTexto Adicionadao a outroTexto " + "E aparecem na mesma página");
            #endregion

            #region InsercaoDeImagens
            Paragraph imagemDaCapa = secaoCapa.AddParagraph();
            imagemDaCapa.AppendText("\n\n\tAgora vamos inserir uma imagem\n\n");
            imagemDaCapa.Format.HorizontalAlignment = HorizontalAlignment.Center;

            // Adiciona uma imagem "imagemExemplo" no paragrafo "imagemDaCapa"
            DocPicture imagemExemplo = imagemDaCapa.AppendPicture(Image.FromFile(@"./saida/img/logo_csharp.png"));

            // Largura e altura
            imagemExemplo.Width  = 300;
            imagemExemplo.Height = 300;
            #endregion

            #region AdicionarNovaSecao
            Section secaoCorpo = exemplo.AddSection();

            Paragraph paragrafoCorpo1 = secaoCorpo.AddParagraph();
            paragrafoCorpo1.AppendText("\tParagrafo criado na secao corpo" + "\tComo foi criada uma nova seção, perceba que este texto aparece em uma nova página");
            #endregion

            #region Tabela
            Table tabela = secaoCorpo.AddTable(true);

            String[] cabecalho = { "Item", "Descrição", "Quantidade", "Preço Unitário", "Preço Total" };

            // Cria uma tabela com dados já inseridos
            String[][] dados =
            {
                new String[] { "Cenoura", "Vegetal muito consumido",          "1", "R$4,00", "R$4,00"  },
                new String[] { "Batata",  "Vegetal muito consumido",          "2", "R$5,00", "R$10,00" },
                new String[] { "Alface",  "Vegetal utilizado desde 500 a.C.", "1", "R$1,50", "R$1,50"  },
                new String[] { "Tomate",  "Tomate é uma fruta",               "2", "R$6,00", "R$12,00" },
            };

            // Adiciona as celulas na tabela
            tabela.ResetCells(dados.Length + 1, cabecalho.Length);

            // Adiciona uma linha na posição 0 do vetor de linhas
            // E define que esta linha é um cabecalho
            TableRow linha1 = tabela.Rows[0];
            linha1.IsHeader = true;

            linha1.Height = 23;

            linha1.RowFormat.BackColor = Color.AliceBlue;

            for (int i = 0; i < cabecalho.Length; i++)
            {
                Paragraph p = linha1.Cells[i].AddParagraph();
                linha1.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                // Formatação dos dados do cabecalho
                TextRange tr = p.AppendText(cabecalho[i]);
                tr.CharacterFormat.FontName  = "Calibri";
                tr.CharacterFormat.FontSize  = 14;
                tr.CharacterFormat.TextColor = Color.Teal;
                tr.CharacterFormat.Bold      = true;
            }

            // Adiciona as linhas do corpo da tabela
            for (int r = 0; r < dados.Length; r++)
            {
                TableRow linhaDados = tabela.Rows[r + 1];
                linhaDados.Height = 20;

                for (int c = 0; c < dados[r].Length; c++)
                {
                    linhaDados.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                    Paragraph p2  = linhaDados.Cells[c].AddParagraph();
                    TextRange tr2 = p2.AppendText(dados[r][c]);

                    p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                    tr2.CharacterFormat.FontName  = "Calibri";
                    tr2.CharacterFormat.FontSize  = 12;
                    tr2.CharacterFormat.TextColor = Color.Brown;
                }
            }
            #endregion

            #region SalvarArquivo
            exemplo.SaveToFile(@"./saida\exemploArquivoWord.docx", FileFormat.Docx);
            #endregion
        }
Ejemplo n.º 19
0
 public void SetOlePicture(DocPicture picture)
 {
     this.method_85(picture);
     base.ImageData = picture;
 }
Ejemplo n.º 20
0
        static void Main(string[] args)
        {
            #region Criacao do documento
            Document exemploDoc = new Document();
            #endregion

            #region Criacao de secao no documento
            //cada secao é tipo uma pagina

            Section secaoCapa = exemploDoc.AddSection();

            #endregion
            // cria um paragrafo e adc na secao
            //os paragrafos são necesseraio para a insençao de texto, img e outra coisas
            #region Adiciona um paragrafo

            Paragraph Titulo = secaoCapa.AddParagraph();

            #endregion

            #region Adiciona texto no paragrafo

            //adc o texto ao paragrafo titulo
            Titulo.AppendText("Exempo de titulo\n\n");

            #endregion

            #region Formata paragrafo

            //atraves da propriedade Hozi..Ali.., é possivel alinhar o paragrafo
            Titulo.Format.HorizontalAlignment = HorizontalAlignment.Center;

            ParagraphStyle estilo01 = new ParagraphStyle(exemploDoc);

            //adc um nome ao estilo01
            estilo01.Name = "Cor do titulo";

            //difinir a cor do titulo
            estilo01.CharacterFormat.TextColor = Color.DarkBlue;

            // define q o texto sera negrito
            estilo01.CharacterFormat.Bold = true;

            // adc estilo01 ao doc exemplodoc
            exemploDoc.Styles.Add(estilo01);

            //Aplica o estilo01 ao paragrafo titulo
            Titulo.ApplyStyle(estilo01.Name);

            #endregion

            #region Trabalhar cm tabulacao

            // adc um parag.. textocapa a secaocapa
            Paragraph TextoCapa = secaoCapa.AddParagraph();

            TextoCapa.AppendText("\t este é um exeplo de texto cm tabulaçaõ\n");

            Paragraph TextoCapa2 = secaoCapa.AddParagraph();

            TextoCapa2.AppendText("\t pgn doc, paragrafo na mesma seção" + "obviamente na mesma seção");

            #endregion

            #region Inserir Imagem

            Paragraph ImagemCapa = secaoCapa.AddParagraph();

            ImagemCapa.AppendText("\n\n\t agrora vamos inserir uma img no doc\n\n");

            //paragrafo com img
            ImagemCapa.Format.HorizontalAlignment = HorizontalAlignment.Center;

            DocPicture ImagemExemplo = ImagemCapa.AppendPicture(Image.FromFile(@"saida\logo_csharp.png"));

            //defini altura e largura img

            ImagemExemplo.Width  = 300;
            ImagemExemplo.Height = 300;

            #endregion

            #region Adc nova secao

            //adc nova secao
            Section secaoCorpo = exemploDoc.AddSection();

            Paragraph paragrafoCorpo1 = secaoCorpo.AddParagraph();

            paragrafoCorpo1.AppendText("exemplo de paragrafo" + "\t o texto aparece em uma nova pgn por ser uma nova secao");

            #endregion

            #region Adc uma tabela

            //criacao de tabela
            Table tabela = secaoCorpo.AddTable(true);

            String[] cabecalho = { "Item", "Descrição", "Qtd", "Preço Unit", "Preço" };

            String[][] dados =
            {
                new String[] { "Cenoura", "Vegetal Nutritivo", "1", "R$ 4,00", "R$ 4,00" },
                new String[] { "Batata",  "Vegetal Nutritivo", "1", "R$ 4,00", "R$ 4,00" },
                new String[] { "Banana",  "Vegetal Nutritivo", "1", "R$ 4,00", "R$ 4,00" },
                new String[] { "Tomate",  "Vegetal Nutritivo", "1", "R$ 4,00", "R$ 4,00" },
            };

            //adc celular
            tabela.ResetCells(dados.Length + 1, cabecalho.Length);

            // adc uma linha na posicao 0 do vetor
            // define q a linha é um cabecalho
            TableRow Linha1 = tabela.Rows[0];
            Linha1.IsHeader = true;

            //define altura da linha
            Linha1.Height = 23;

            //formata cabecalho
            Linha1.RowFormat.BackColor = Color.AliceBlue;

            for (int i = 0; i < cabecalho.Length; i++)
            {
                Paragraph p = Linha1.Cells[i].AddParagraph();
                Linha1.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                //formata dados do cabecalho

                TextRange TR = p.AppendText(cabecalho[i]);
                TR.CharacterFormat.FontName  = "Calibre";
                TR.CharacterFormat.FontSize  = 14;
                TR.CharacterFormat.TextColor = Color.Teal;
                TR.CharacterFormat.Bold      = true;
            }

            //adc  as linhas do corpo da tabela

            for (int r = 0; r < dados.Length; r++)
            {
                TableRow LinhaDados = tabela.Rows[r + 1];

                //define altura da linha
                LinhaDados.Height = 20;

                for (int c = 0; c < dados[r].Length; c++)
                {
                    //alinha as celulas
                    LinhaDados.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                    //preenche dados nas linhas
                    Paragraph p2 = LinhaDados.Cells[c].AddParagraph();

                    TextRange TR2 = p2.AppendText(dados[r][c]);

                    //formata celulas

                    p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                    TR2.CharacterFormat.FontName  = "Calibre";
                    TR2.CharacterFormat.FontSize  = 12;
                    TR2.CharacterFormat.TextColor = Color.Brown;
                }
            }

            #endregion

            #region Salvar Arquivo

            // salva arquivo em docx
            //savefile para salvar como deseja
            exemploDoc.SaveToFile(@"saida\aula-7.docx", FileFormat.Docx);

            #endregion
        }
Ejemplo n.º 21
0
 public string method_9(DocPicture A_0)
 {
     return(this.method_3().method_335(A_0, false, null));
 }
        private void button1_Click(object sender, EventArgs e)
        {
            //Creat a new word document.
            Document  document  = new Document();
            Section   section   = document.AddSection();
            Paragraph paragraph = section.AddParagraph();
            TextRange txtRange  = paragraph.AppendText("The following example shows how to add content controls in a Word document.");

            paragraph = section.AddParagraph();

            //Add Combo Box Content Control.
            paragraph = section.AddParagraph();
            txtRange  = paragraph.AppendText("Add Combo Box Content Control:  ");
            txtRange.CharacterFormat.Italic = true;
            StructureDocumentTagInline sd = new StructureDocumentTagInline(document);

            paragraph.ChildObjects.Add(sd);
            sd.SDTProperties.SDTType = SdtType.ComboBox;
            SdtComboBox cb = new SdtComboBox();

            cb.ListItems.Add(new SdtListItem("Spire.Doc"));
            cb.ListItems.Add(new SdtListItem("Spire.XLS"));
            cb.ListItems.Add(new SdtListItem("Spire.PDF"));
            sd.SDTProperties.ControlProperties = cb;
            TextRange rt = new TextRange(document);

            rt.Text = cb.ListItems[0].DisplayText;
            sd.SDTContent.ChildObjects.Add(rt);

            section.AddParagraph();

            //Add Text Content Control.
            paragraph = section.AddParagraph();
            txtRange  = paragraph.AppendText("Add Text Content Control:  ");
            txtRange.CharacterFormat.Italic = true;
            sd = new StructureDocumentTagInline(document);
            paragraph.ChildObjects.Add(sd);
            sd.SDTProperties.SDTType = SdtType.Text;
            SdtText text = new SdtText(true);

            text.IsMultiline = true;
            sd.SDTProperties.ControlProperties = text;
            rt      = new TextRange(document);
            rt.Text = "Text";
            sd.SDTContent.ChildObjects.Add(rt);

            section.AddParagraph();

            //Add Picture Content Control.
            paragraph = section.AddParagraph();
            txtRange  = paragraph.AppendText("Add Picture Content Control:  ");
            txtRange.CharacterFormat.Italic = true;
            sd = new StructureDocumentTagInline(document);
            paragraph.ChildObjects.Add(sd);
            sd.SDTProperties.SDTType = SdtType.Picture;
            DocPicture pic = new DocPicture(document);

            pic.Width  = 10;
            pic.Height = 10;
            pic.LoadImage(Image.FromFile(@"..\..\..\..\..\..\Data\logo.png"));
            sd.SDTContent.ChildObjects.Add(pic);

            section.AddParagraph();

            //Add Date Picker Content Control.
            paragraph = section.AddParagraph();
            txtRange  = paragraph.AppendText("Add Date Picker Content Control:  ");
            txtRange.CharacterFormat.Italic = true;
            sd = new StructureDocumentTagInline(document);
            paragraph.ChildObjects.Add(sd);
            sd.SDTProperties.SDTType = SdtType.DatePicker;
            SdtDate date = new SdtDate();

            date.CalendarType = CalendarType.Default;
            date.DateFormat   = "yyyy.MM.dd";
            date.FullDate     = DateTime.Now;
            sd.SDTProperties.ControlProperties = date;
            rt      = new TextRange(document);
            rt.Text = "1990.02.08";
            sd.SDTContent.ChildObjects.Add(rt);

            section.AddParagraph();

            //Add Drop-Down List Content Control.
            paragraph = section.AddParagraph();
            txtRange  = paragraph.AppendText("Add Drop-Down List Content Control:  ");
            txtRange.CharacterFormat.Italic = true;
            sd = new StructureDocumentTagInline(document);
            paragraph.ChildObjects.Add(sd);
            sd.SDTProperties.SDTType = SdtType.DropDownList;
            SdtDropDownList sddl = new SdtDropDownList();

            sddl.ListItems.Add(new SdtListItem("Harry"));
            sddl.ListItems.Add(new SdtListItem("Jerry"));
            sd.SDTProperties.ControlProperties = sddl;
            rt      = new TextRange(document);
            rt.Text = sddl.ListItems[0].DisplayText;
            sd.SDTContent.ChildObjects.Add(rt);

            //Save the document.
            string resultfile = "Output.docx";

            document.SaveToFile(resultfile, FileFormat.Docx);

            //Launch the Word file.
            FileViewer(resultfile);
        }
        static void Main(string[] args)
        {
            #region criacao de documento
            //criação de um documento com nome exemplodoc
            Document exemploDoc = new Document();
            #endregion

            //adicionada uma seção com o nome secaocapa ao documento
            //cada secao pode ser entendida como uma página do documento
            #region
            Section secaoCapa = exemploDoc.AddSection();
            #endregion

            #region criar um parágrafo
            Paragraph titulo = secaoCapa.AddParagraph();
            #endregion

            #region
            titulo.AppendText("Exemplo de título\n\n");
            #endregion

            #region Formatar parágrafo

            //define o alinhamento com uma propriedade
            titulo.Format.HorizontalAlignment = HorizontalAlignment.Center;

            //criação de um novo estilo de formatação e adição ao documento correspondente
            ParagraphStyle estilo01 = new ParagraphStyle(exemploDoc);

            //adiciona nome ao estilo01
            estilo01.Name = "Cor do titulo";

            //Adiciona cor ao texto
            estilo01.CharacterFormat.TextColor = Color.Cyan;

            //define que o texto estará em negrito
            estilo01.CharacterFormat.Bold = true;

            //adiciona o estilo no documento exemploDoc
            exemploDoc.Styles.Add(estilo01);

            //aplica o estilo01 ao parágrafo do título
            titulo.ApplyStyle(estilo01.Name);

            #endregion

            #region trabalhar com tabulação
            //adiciona um parágrafo textoCapa á seção textoCapa
            Paragraph textoCapa = secaoCapa.AddParagraph();

            //Escreve o que aparece no parágrafo, usa tabulação (\t)
            textoCapa.AppendText("\tEste é um exemplo de texto com tabulação");

            //adiciona outro parágrafo na mesma seção
            Paragraph textoCapa2 = secaoCapa.AddParagraph();

            //escreve mais um parágrafo
            textoCapa.AppendText("\tUma seção representa uma página do documento e os parágrafos dentro de uma mesma seção aparecem dentro da mesma página");

            #endregion

            #region Inserir imagem
            //adiciona o parágrafo na secaoCapa
            Paragraph imagemCapa = secaoCapa.AddParagraph();

            //adiciona o texto ao paragrafo imagemCapa
            imagemCapa.AppendText("\n\nAgora vamos inserir uma imagem ao documento\n\n");

            //centraliza horizontalmente o parágrafo imagemCapa
            imagemCapa.Format.HorizontalAlignment = HorizontalAlignment.Center;

            //adiciona uma imagem com nome imagemExemplo
            DocPicture imagemExemplo = imagemCapa.AppendPicture(Image.FromFile(@"saida\img\logo_csharp.png"));

            //ddefine largura e altura para a imagem
            imagemExemplo.Width  = 300;
            imagemExemplo.Height = 300;
            #endregion

            #region Adiciona uma nova seção

            //adiciona uma nova seção
            Section secaoCorpo = exemploDoc.AddSection();

            //adiciona um paragrafo á seçãoCorpo
            Paragraph paragrafoCorpo1 = secaoCorpo.AddParagraph();

            //adiciona um texto ao paragrafo paragrafoCorpo1
            paragrafoCorpo1.AppendText("\tExemplo de paragrafo criado em uma nova seção. aparece em uma nova página já que foi criado em outra seção");

            #endregion

            #region Adicionar tabela

            //adiciona uma tabela a secaoCorpo
            Table tabela = secaoCorpo.AddTable(true);

            //cria o cabeçalho da tabela
            String[] cabecalho = { "Item", "Descrição", "Qtde.", "Preço Unit.", "Preço" };

            //definidos os dados da tabela
            String[][] dados =
            {
                new String[] { "Cenoura", "Vegetal muito nutritivo",      "1", "R$4,00", "R$4,00"  },
                new String[] { "Batata",  "Vegetal muito consumido",      "2", "R$5,00", "R$10,00" },
                new String[] { "Alface",  "Vegetal usado desde 500 a.C.", "1", "R$1,50", "R$1,50"  },
                new String[] { "Tomate",  "Tomate é fruta",               "2", "R$6,00", "R$12,00" }
            };

            //Adiciona as células na tabela
            tabela.ResetCells(dados.Length + 1, cabecalho.Length);

            //adiciona uma linha na posição [0] no vetor de linhas e define que essa linha é o cabeçalho
            TableRow Linha1 = tabela.Rows[0];
            Linha1.IsHeader = true;

            //define a altura da linha
            Linha1.Height = 23;

            //formatação do cabeçalho
            Linha1.RowFormat.BackColor = Color.AliceBlue;

            //percorre as linhas do cabeçalho
            for (int i = 0; i < cabecalho.Length; i++)
            {
                //adiciona um parágrafo chamado p, formata o conteúdo da célula para o centro, e alinha o texto para o centro
                Paragraph p = Linha1.Cells[i].AddParagraph();
                Linha1.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                p.Format.HorizontalAlignment = HorizontalAlignment.Center;

                //formatação dos dados do cabeçalho
                TextRange TR = p.AppendText(cabecalho[i]);
                TR.CharacterFormat.FontName  = "Calibri";
                TR.CharacterFormat.FontSize  = 14;
                TR.CharacterFormat.TextColor = Color.Teal;
                TR.CharacterFormat.Bold      = true;
            }

            //adiciona as linhas do corpo da tabela
            for (int r = 0; r < dados.Length; r++)
            {
                //percorre todos os dados, menos a primeira, que é a do cabeçalho
                TableRow LinhaDados = tabela.Rows[r + 1];

                //define a altura da linha
                LinhaDados.Height = 20;

                //percorre as colunas
                for (int c = 0; c < dados[r].Length; c++)
                {
                    //alinha as células
                    LinhaDados.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;

                    //preenche os dados nas linhas
                    Paragraph p2 = LinhaDados.Cells[c].AddParagraph();

                    TextRange TR2 = p2.AppendText(dados[r][c]);

                    //formatação do paragrafo p2
                    p2.Format.HorizontalAlignment = HorizontalAlignment.Center;
                    TR2.CharacterFormat.FontName  = "Calibri";
                    TR2.CharacterFormat.FontSize  = 12;
                    TR2.CharacterFormat.TextColor = Color.Brown;
                }
            }

            #endregion

            #region Salvar arquivo

            //salva o arquivo em docx
            exemploDoc.SaveToFile(@"saida\exemplo_arquivo_word.docx", FileFormat.Docx);
            #endregion
        }
Ejemplo n.º 24
0
        public string NewDoc(string pathTemplate, string pathFile, string lastName, string firstName, string middleName, string birthDate, int loanSum, string inputImage)
        {
            if (!File.Exists(pathTemplate))
            {
                return("Папка не найдена, обратитесь к администратору или выберите другую");
            }
            string imagesFolder = AppDomain.CurrentDomain.BaseDirectory + "Resources\\Images\\";

            Document document = new Document();

            document.LoadFromFile(pathTemplate);

            TextSelection[] selections = document.FindAllString("[image]", true, true);
            int             index      = 0;
            TextRange       range      = null;

            foreach (TextSelection selection in selections)
            {
                DocPicture pic = new DocPicture(document);
                try
                {
                    pic.LoadImage(Image.FromFile(imagesFolder + inputImage));
                }
                catch
                {
                    System.Threading.Thread.Sleep(2000);
                    pic.LoadImage(Image.FromFile(imagesFolder + inputImage));
                }
                pic.Width  = 250;
                pic.Height = 268;
                range      = selection.GetAsOneRange();
                index      = range.OwnerParagraph.ChildObjects.IndexOf(range);
                range.OwnerParagraph.ChildObjects.Insert(index, pic);
                range.OwnerParagraph.ChildObjects.Remove(range);
            }

            document.Replace("[lastName]", lastName, false, true);
            document.Replace("[firstName]", firstName, false, true);
            document.Replace("[middleName]", middleName, false, true);
            document.Replace("[birthDate]", birthDate, false, true);
            document.Replace("[loanSum]", loanSum.ToString(), false, true);
            document.SaveToFile(pathFile, FileFormat.Docx);
            document.Close();

            DirectoryInfo dirInfo = new DirectoryInfo(imagesFolder);

            foreach (FileInfo file in dirInfo.GetFiles())
            {
                try
                {
                    file.Delete();
                }
                catch
                {
                    System.Threading.Thread.Sleep(2000);
                    file.Delete();
                }
            }

            return(pathFile);
        }
Ejemplo n.º 25
0
        private void button1_Click(object sender, EventArgs e)
        {
            Document  doc     = new Document();
            Section   section = doc.AddSection();
            Paragraph para    = section.AddParagraph();

            //Create table of content with default switches(\o "1-3" \h \z)
            para.AppendTOC(1, 3);

            Paragraph par = section.AddParagraph();
            TextRange tr  = par.AppendText("Flowers");

            tr.CharacterFormat.FontSize    = 30;
            par.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;

            //Create paragraph and set the head level
            Paragraph para1 = section.AddParagraph();

            para1.AppendText("Ornithogalum");
            //Apply the Heading1 style
            para1.ApplyStyle(BuiltinStyle.Heading1);
            //Add paragraphs
            para1 = section.AddParagraph();
            DocPicture picture = para1.AppendPicture(Image.FromFile(@"..\..\..\..\..\..\Data\Ornithogalum.jpg"));

            picture.TextWrappingStyle = TextWrappingStyle.Square;
            para1.AppendText("Ornithogalum is a genus of perennial plants mostly native to southern Europe and southern Africa belonging to the family Asparagaceae. Some species are native to other areas such as the Caucasus. Growing from a bulb, species have linear basal leaves and a slender stalk, up to 30 cm tall, bearing clusters of typically white star-shaped flowers, often striped with green.");
            para1 = section.AddParagraph();


            Paragraph para2 = section.AddParagraph();

            para2.AppendText("Rosa");
            //Apply the Heading2 style
            para2.ApplyStyle(BuiltinStyle.Heading2);
            para2 = section.AddParagraph();
            DocPicture picture2 = para2.AppendPicture(Image.FromFile(@"..\..\..\..\..\..\Data\Rosa.jpg"));

            picture2.TextWrappingStyle = TextWrappingStyle.Square;
            para2.AppendText("A rose is a woody perennial flowering plant of the genus Rosa, in the family Rosaceae, or the flower it bears. There are over a hundred species and thousands of cultivars. They form a group of plants that can be erect shrubs, climbing or trailing with stems that are often armed with sharp prickles. Flowers vary in size and shape and are usually large and showy, in colours ranging from white through yellows and reds. Most species are native to Asia, with smaller numbers native to Europe, North America, and northwestern Africa. Species, cultivars and hybrids are all widely grown for their beauty and often are fragrant. Roses have acquired cultural significance in many societies. Rose plants range in size from compact, miniature roses, to climbers that can reach seven meters in height. Different species hybridize easily, and this has been used in the development of the wide range of garden roses.");
            section.AddParagraph();

            Paragraph para3 = section.AddParagraph();

            para3.AppendText("Hyacinth");
            //Apply the Heading3 style
            para3.ApplyStyle(BuiltinStyle.Heading3);
            para3 = section.AddParagraph();
            DocPicture picture3 = para3.AppendPicture(Image.FromFile(@"..\..\..\..\..\..\Data\hyacinths.JPG"));

            picture3.TextWrappingStyle = TextWrappingStyle.Tight;
            para3.AppendText("Hyacinthus is a small genus of bulbous, fragrant flowering plants in the family Asparagaceae, subfamily Scilloideae.These are commonly called hyacinths.The genus is native to the eastern Mediterranean (from the south of Turkey through to northern Israel).");
            para3 = section.AddParagraph();
            para3.AppendText("Several species of Brodiea, Scilla, and other plants that were formerly classified in the lily family and have flower clusters borne along the stalk also have common names with the word \"hyacinth\" in them. Hyacinths should also not be confused with the genus Muscari, which are commonly known as grape hyacinths.");

            //Update TOC
            doc.UpdateTableOfContents();
            //Save to file
            doc.SaveToFile("result.docx", FileFormat.Docx);
            //Launch the Word file
            FileViewer("result.docx");
        }
Ejemplo n.º 26
0
        private void InsertComments(Section section)
        {
            //title
            Paragraph paragraph
                = section.Paragraphs.Count > 0 ? section.Paragraphs[0] : section.AddParagraph();
            TextRange title = paragraph.AppendText("Summary of Science");

            title.CharacterFormat.Bold     = true;
            title.CharacterFormat.FontName = "Arial";
            title.CharacterFormat.FontSize = 14;
            paragraph.Format.HorizontalAlignment
                = Spire.Doc.Documents.HorizontalAlignment.Center;
            paragraph.Format.AfterSpacing = 10;

            //style
            ParagraphStyle style1 = new ParagraphStyle(section.Document);

            style1.Name = "style1";
            style1.CharacterFormat.FontName        = "Arial";
            style1.CharacterFormat.FontSize        = 9;
            style1.ParagraphFormat.LineSpacing     = 1.5F * 12F;
            style1.ParagraphFormat.LineSpacingRule = LineSpacingRule.Multiple;
            section.Document.Styles.Add(style1);

            ParagraphStyle style2 = new ParagraphStyle(section.Document);

            style2.Name = "style2";
            style2.ApplyBaseStyle(style1.Name);
            style2.CharacterFormat.Font = new Font("Arial", 10f);
            section.Document.Styles.Add(style2);

            paragraph = section.AddParagraph();
            paragraph.AppendText("(All text and pictures are from ");
            TextRange text = paragraph.AppendText("Wikipedia");

            //Comment Wikipedia, adding url for it.
            Comment comment1 = paragraph.AppendComment("http://en.wikipedia.org/wiki/Science");

            comment1.AddItem(text);
            comment1.Format.Author  = "Harry Hu";
            comment1.Format.Initial = "HH";
            paragraph.AppendText(", the free encyclopedia)");
            paragraph.ApplyStyle(style1.Name);

            Paragraph paragraph1 = section.AddParagraph();
            String    str1
                = "Science (from the Latin scientia, meaning \"knowledge\") "
                  + "is an enterprise that builds and organizes knowledge in the form "
                  + "of testable explanations and predictions about the natural world. "
                  + "An older meaning still in use today is that of Aristotle, "
                  + "for whom scientific knowledge was a body of reliable knowledge "
                  + "that can be logically and rationally explained "
                  + "(see \"History and etymology\" section below).";

            paragraph1.AppendText(str1);

            //Simple comment
            Comment comment2 = paragraph1.AppendComment("Not given in this file.");

            comment2.Format.Author  = "Harry Hu";
            comment2.Format.Initial = "HH";

            //Insert a picture in the right of the paragraph1
            DocPicture picture
                = paragraph1.AppendPicture(Image.FromFile(@"..\..\..\..\..\..\Data\Wikipedia_Science.png"));

            picture.TextWrappingStyle   = TextWrappingStyle.Square;
            picture.TextWrappingType    = TextWrappingType.Left;
            picture.VerticalOrigin      = VerticalOrigin.Paragraph;
            picture.VerticalPosition    = 0;
            picture.HorizontalOrigin    = HorizontalOrigin.Column;
            picture.HorizontalAlignment = ShapeHorizontalAlignment.Right;

            paragraph1.ApplyStyle(style2.Name);

            Paragraph paragraph2 = section.AddParagraph();
            String    str2
                = "Since classical antiquity science as a type of knowledge was closely linked "
                  + "to philosophy, the way of life dedicated to discovering such knowledge. "
                  + "And into early modern times the two words, \"science\" and \"philosophy\", "
                  + "were sometimes used interchangeably in the English language. "
                  + "By the 17th century, \"natural philosophy\" "
                  + "(which is today called \"natural science\") could be considered separately "
                  + "from \"philosophy\" in general. But \"science\" continued to also be used "
                  + "in a broad sense denoting reliable knowledge about a topic, in the same way "
                  + "it is still used in modern terms such as library science or political science.";

            paragraph2.AppendText(str2);
            paragraph2.ApplyStyle(style2.Name);

            Paragraph paragraph3 = section.AddParagraph();
            String    str3
                = "The more narrow sense of \"science\" that is common today developed as a part "
                  + "of science became a distinct enterprise of defining \"laws of nature\", "
                  + "based on early examples such as Kepler's laws, Galileo's laws, and Newton's "
                  + "laws of motion. In this period it became more common to refer to natural "
                  + "philosophy as  \"natural science\". Over the course of the 19th century, the word "
                  + "\"science\" became increasingly associated with the disciplined study of the "
                  + "natural world including physics, chemistry, geology and biology. This sometimes "
                  + "left the study of human thought and society in a linguistic limbo, which was "
                  + "resolved by classifying these areas of academic study as social science. "
                  + "Similarly, several other major areas of disciplined study and knowledge "
                  + "exist today under the general rubric of \"science\", such as formal science "
                  + "and applied science.";

            paragraph3.AppendText(str3);
            paragraph3.ApplyStyle(style2.Name);
        }
Ejemplo n.º 27
0
    internal static void smethod_1(ShapeBase A_0, bool A_1, Class398 A_2, Interface48 A_3)
    {
        int    num  = 11;
        string str  = BookmarkStart.b("䜰ल䘴弶堸䬺堼", 11);
        string item = null;
        bool   flag = false;

        switch (A_0.ShapeType)
        {
        case ShapeType.OleObject:
            item = string.Format(BookmarkStart.b("ሰ氲䴴ܶस଺഼怾㕀㡂畄㩆", num), 0x4b);
            flag = true;
            break;

        case ShapeType.Group:
            str = BookmarkStart.b("䜰ल刴䔶嘸为䴼", num);
            break;

        case ShapeType.NonPrimitive:
            str = BookmarkStart.b("䜰ल䘴弶堸䬺堼", num);
            break;

        case ShapeType.Rectangle:
            str = BookmarkStart.b("䜰ल䜴制娸伺", num);
            break;

        case ShapeType.RoundRectangle:
            str = BookmarkStart.b("䜰ल䜴堶䰸唺夼䴾⑀⁂ㅄ", num);
            break;

        case ShapeType.Ellipse:
            str = BookmarkStart.b("䜰ल娴䄶堸场", num);
            break;

        case ShapeType.Line:
            str = BookmarkStart.b("䜰ल头帶圸帺", num);
            break;

        default:
            item = string.Format(BookmarkStart.b("ሰ氲䴴ܶस଺഼怾㕀㡂畄㩆", num), (int)A_0.ShapeType);
            flag = true;
            break;
        }
        if (A_1)
        {
            str = BookmarkStart.b("䜰ल圴嘶娸债娼䴾⹀㙂⭄⍆", num);
        }
        Class965  class3    = new Class965(A_0, A_2, A_3);
        Class82   class4    = new Class82(A_0, A_2, A_3);
        Class333  class2    = new Class333(A_0, A_2, A_3);
        Class845  class5    = new Class845(A_2);
        Class235  class6    = new Class235(A_2);
        Class234  class7    = new Class234(A_0, A_2);
        Class686  class8    = new Class686(A_2);
        Class332  class9    = new Class332(A_2);
        Class1039 class10   = new Class1039(A_3, A_2);
        Class788  class11   = new Class788(A_2);
        Class844  class12   = new Class844(A_2);
        string    str3      = null;
        string    str4      = null;
        Hashtable hashtable = new Hashtable();
        Class43   shapePr   = A_0.ShapePr;

        for (int i = 0; i < shapePr.Count; i++)
        {
            int    num2 = shapePr.method_18(i);
            object obj2 = shapePr.method_19(i);
            int    num8 = num2 & -64;
            if (num8 <= 0x180)
            {
                if (num8 <= 0xc0)
                {
                    if (num8 != 0x40)
                    {
                        if (num8 != 0xc0)
                        {
                            goto Label_029D;
                        }
                        class8.method_0(num2, obj2);
                    }
                    else
                    {
                        class9.method_0(num2, obj2);
                    }
                }
                else
                {
                    switch (num8)
                    {
                    case 0x100:
                    {
                        class2.method_0(num2, obj2);
                        continue;
                    }

                    case 320:
                    {
                        class7.method_0(num2, obj2);
                        continue;
                    }
                    }
                    if (num8 != 0x180)
                    {
                        goto Label_029D;
                    }
                    class3.method_0(num2, obj2);
                }
                continue;
            }
            switch (num8)
            {
            case 0x1c0:
            {
                if (num2 == 0x1fb)
                {
                    class7.method_0(num2, obj2);
                }
                else
                {
                    class4.method_0(num2, obj2);
                }
                continue;
            }

            case 0x200:
            {
                class5.method_0(num2, obj2);
                continue;
            }

            case 640:
            case 0x2c0:
            {
                class6.method_0(num2, obj2);
                continue;
            }

            case 0x340:
            {
                class11.method_0(num2, obj2);
                continue;
            }

            case 0x500:
            {
                class10.method_0(num2, obj2);
                continue;
            }
            }
Label_029D:
            switch (num2)
            {
            case 0x85:
            {
                hashtable[num2] = Class1085.smethod_54((TextBoxWrapMode)obj2);
                continue;
            }

            case 0x87:
            {
                hashtable[num2] = Class1085.smethod_52((TextBoxAnchor)obj2);
                continue;
            }

            case 190:
            {
                if ((bool)obj2)
                {
                    hashtable[num2] = BookmarkStart.b("䔰", num);
                }
                continue;
            }

            case 0x303:
            {
                hashtable[num2] = Class1085.smethod_58((ConnectorType)obj2);
                continue;
            }

            case 0x304:
            case 0x305:
            case 0x306:
            {
                hashtable[num2] = Class1085.smethod_6((BWMode)obj2);
                continue;
            }

            case 0x309:
            {
                str3 = Class1041.smethod_8((int)obj2);
                continue;
            }

            case 0x30a:
            {
                str4 = Class1041.smethod_8((int)obj2);
                continue;
            }

            case 0x33c:
            {
                class9.method_0(num2, obj2);
                continue;
            }

            case 900:
            case 0x385:
            case 0x386:
            case 0x387:
            {
                hashtable[num2] = Class969.smethod_42((int)obj2);
                continue;
            }

            case 0x38f:
            {
                HorizontalPosition position2 = (HorizontalPosition)obj2;
                if (position2 != HorizontalPosition.None)
                {
                    hashtable[num2] = Class417.smethod_18(position2);
                }
                continue;
            }

            case 0x390:
            {
                HorizontalOrigin origin2 = (HorizontalOrigin)obj2;
                if (origin2 != HorizontalOrigin.Column)
                {
                    hashtable[num2] = Class417.smethod_16(origin2);
                }
                continue;
            }

            case 0x391:
            {
                VerticalPosition position = (VerticalPosition)obj2;
                if (position != VerticalPosition.None)
                {
                    hashtable[num2] = Class417.smethod_23(position);
                }
                continue;
            }

            case 0x392:
            {
                VerticalOrigin origin = (VerticalOrigin)obj2;
                if (origin != VerticalOrigin.Paragraph)
                {
                    hashtable[num2] = Class417.smethod_14(origin);
                }
                continue;
            }

            case 0x394:
            {
                ShapeHorizontalAlignment alignment = (ShapeHorizontalAlignment)obj2;
                if (alignment != ShapeHorizontalAlignment.Left)
                {
                    hashtable[num2] = Class1085.smethod_10(alignment);
                }
                continue;
            }

            case 0x781:
            case 0x782:
            case 0x783:
            case 0x784:
            case 0x785:
            case 0x786:
            case 0x787:
            case 0x788:
            case 0x7bc:
            case 0x7bd:
            case 0x7be:
            case 0x7bf:
            {
                class12.method_0(num2, obj2);
                continue;
            }

            case 0x7c0:
            case 0x7c1:
            case 0x7c2:
            case 0x7c3:
            {
                hashtable[num2] = Class1041.smethod_30((int)((float)obj2));
                continue;
            }

            case 0x7c4:
            {
                hashtable[num2] = Class417.smethod_11((RelativeWidth)obj2);
                continue;
            }

            case 0x7c5:
            {
                hashtable[num2] = Class417.smethod_9((RelativeHeight)obj2);
                continue;
            }

            case 0x1000:
            {
                hashtable[num2] = Class1085.smethod_68((FlipOrientation)obj2);
                continue;
            }

            case 0x1006:
            case 0x1007:
            case 0x1008:
            {
                class2.method_0(num2, obj2);
                continue;
            }

            case 0x100e:
            {
                class4.method_0(num2, obj2);
                continue;
            }

            case 0x100f:
            {
                class3.method_0(num2, obj2);
                continue;
            }

            case 0x101d:
            case 0x101e:
            case 0x101f:
            case 0x1020:
            {
                hashtable[num2] = (int)obj2;
                continue;
            }
            }
            hashtable[num2] = obj2;
        }
        if ((!A_3.imethod_7() && (hashtable[0x3b8] != null)) && ((bool)hashtable[0x3b8]))
        {
            string str7;
            if (hashtable[0x39a] != null)
            {
                str7 = hashtable[0x39a] as string;
            }
            else
            {
                str7 = Class1085.smethod_2(hashtable[920]);
            }
            A_2.method_4(BookmarkStart.b("䘰ल䘴吶䬸刺䴼䬾@ⵂ♄⽆♈㥊", num));
            A_2.method_11(BookmarkStart.b("䘰ल头嘶圸尺䠼帾♀♂", num), str7);
            A_2.method_11(BookmarkStart.b("䘰ल吴䔶常䠺", num), hashtable[0x397] as string);
            A_2.method_11(BookmarkStart.b("䘰ल䘴吶䬸刺䴼䬾ᕀ♂㵄㍆", num), hashtable[910] as string);
        }
        else
        {
            if ((!A_3.imethod_7() && flag) && !A_3.imethod_3().Contains(item))
            {
                A_3.imethod_3().Add(item);
                string str6 = Class565.smethod_0(A_0.ShapeType);
                if (Class567.smethod_16(str6))
                {
                    A_2.method_9(BookmarkStart.b("㰰㤲", num));
                    A_2.method_9(str6);
                    A_2.method_9(BookmarkStart.b("㰰㤲", num));
                }
            }
            if (class2.method_2() != null)
            {
                class2.method_4(A_3.imethod_1(class2.method_2()));
                if (Class567.smethod_16(class2.method_5()) && (class2.method_5() != class2.method_3()))
                {
                    class2.method_6(A_3.imethod_2(class2.method_5()));
                }
            }
            else if (Class567.smethod_16(class2.method_5()))
            {
                class2.method_4(A_3.imethod_2(class2.method_5()));
            }
            if (class3.method_3() != null)
            {
                class3.method_5(A_3.imethod_1(class3.method_3()));
            }
            if (class4.method_3() != null)
            {
                class4.method_5(A_3.imethod_1(class4.method_3()));
            }
            A_2.method_4(str);
            if (A_0.ShapeType == ShapeType.CustomShape)
            {
                string str8 = (string)hashtable[0x380];
                if (Class567.smethod_16(str8))
                {
                    if (A_0 is DocOleObject)
                    {
                        string str10 = Class734.smethod_3(A_0);
                        A_2.method_36(BookmarkStart.b("堰圲", num), str10);
                        A_2.method_36(BookmarkStart.b("帰ल䘴䜶倸强", num), str10);
                    }
                    else
                    {
                        A_2.method_36(BookmarkStart.b("堰圲", num), str8);
                        A_2.method_36(BookmarkStart.b("帰ल䘴䜶倸强", num), Class734.smethod_3(A_0));
                    }
                }
                else
                {
                    A_2.method_36(BookmarkStart.b("堰圲", num), Class734.smethod_3(A_0));
                }
                if (class4.method_6() == null)
                {
                    class4.method_7(BookmarkStart.b("尰娲䄴制䬸", num));
                }
                if (hashtable[0x101f] == null)
                {
                    hashtable[0x101f] = A_0.CoordSizeWidth;
                }
                if (hashtable[0x1020] == null)
                {
                    hashtable[0x1020] = A_0.CoordSizeHeight;
                }
            }
            else if (Class567.smethod_16((string)hashtable[0x380]))
            {
                if (A_0 is DocOleObject)
                {
                    string str11 = Class734.smethod_3(A_0);
                    A_2.method_36(BookmarkStart.b("堰圲", num), str11);
                    A_2.method_36(BookmarkStart.b("帰ल䘴䜶倸强", num), str11);
                }
                else
                {
                    A_2.method_36(BookmarkStart.b("堰圲", num), hashtable[0x380]);
                    A_2.method_36(BookmarkStart.b("帰ल䘴䜶倸强", num), Class734.smethod_3(A_0));
                }
                A_2.method_36(BookmarkStart.b("䔰䨲䔴制", num), item);
            }
            else
            {
                A_2.method_36(BookmarkStart.b("堰圲", num), Class734.smethod_3(A_0));
                A_2.method_36(BookmarkStart.b("䔰䨲䔴制", num), item);
                A_2.method_36(BookmarkStart.b("吰圲尴䌶堸䠺", num), class10.method_2());
            }
            if (A_0.IsInline && A_0.IsImage)
            {
                A_2.method_36(BookmarkStart.b("倰弲䄴", num), hashtable[0x381]);
            }
            else
            {
                A_2.method_36(BookmarkStart.b("夰䄲倴儶", num), hashtable[0x382]);
                A_2.method_36(BookmarkStart.b("䔰刲䜴倶尸伺", num), hashtable[0x1018]);
                A_2.method_36(BookmarkStart.b("䔰娲䄴嬶尸", num), hashtable[0x38d]);
                A_2.method_36(BookmarkStart.b("倰弲䄴", num), hashtable[0x381]);
            }
            if (!A_1)
            {
                Class558 class14 = new Class558();
                if (!A_0.IsInline)
                {
                    class14.method_2(BookmarkStart.b("䄰尲䘴帶䴸刺刼儾", num), BookmarkStart.b("倰儲䘴堶唸为䤼娾", num));
                }
                string str5 = "";
                if (A_0.IsTopLevel)
                {
                    str5 = BookmarkStart.b("尰刲䜴倶倸唺ြ", num);
                }
                if (A_0.ShapeType != ShapeType.Line)
                {
                    if (!A_0.IsInline)
                    {
                        if (A_0.IsTopLevel || (A_0.Left != 0.0))
                        {
                            class14.method_2(str5 + BookmarkStart.b("崰嘲匴䌶", num), Class734.smethod_19(A_0.Left, A_0.IsTopLevel));
                        }
                        if (A_0.IsTopLevel || (A_0.Top != 0.0))
                        {
                            class14.method_2(str5 + BookmarkStart.b("䔰尲䔴", num), Class734.smethod_19(A_0.Top, A_0.IsTopLevel));
                        }
                    }
                    if ((A_0.ShapeType != ShapeType.Image) && (A_0.ShapeType != ShapeType.OleObject))
                    {
                        class14.method_2(BookmarkStart.b("䘰娲儴䌶儸", num), Class734.smethod_19(A_0.Width, A_0.IsTopLevel));
                        class14.method_2(BookmarkStart.b("夰嘲尴倶儸伺", num), Class734.smethod_19(A_0.Height, A_0.IsTopLevel));
                    }
                    else
                    {
                        DocPicture imageData = (A_0 as ShapeObject).ImageData;
                        float      num6      = imageData.WidthScale / 100f;
                        float      num7      = imageData.HeightScale / 100f;
                        class14.method_2(BookmarkStart.b("䘰娲儴䌶儸", num), Class734.smethod_19(A_0.Width * num6, A_0.IsTopLevel));
                        class14.method_2(BookmarkStart.b("夰嘲尴倶儸伺", num), Class734.smethod_19(A_0.Height * num7, A_0.IsTopLevel));
                    }
                }
                object obj4 = hashtable[4];
                if (obj4 != null)
                {
                    class14.method_2(BookmarkStart.b("䌰尲䄴嘶䴸刺刼儾", num), Class734.smethod_14(Convert.ToInt32(obj4)));
                }
                if (Class567.smethod_16((string)hashtable[0x1000]))
                {
                    class14.method_2(BookmarkStart.b("地弲尴䜶", num), (string)hashtable[0x1000]);
                }
                if (A_0.IsTopLevel && !A_0.IsInline)
                {
                    if (A_0.BehindText && (A_0.ZOrder > 0L))
                    {
                        class14.method_4(BookmarkStart.b("䬰Ḳ尴夶崸帺䔼", num), (double)A_0.ZOrderEx);
                    }
                    else
                    {
                        class14.method_4(BookmarkStart.b("䬰Ḳ尴夶崸帺䔼", num), (double)A_0.ZOrder);
                    }
                }
                if (hashtable[0x3be] != null)
                {
                    class14.method_2(BookmarkStart.b("䜰娲䘴帶嬸刺儼嘾㕀㩂", num), ((bool)hashtable[0x3be]) ? BookmarkStart.b("夰娲儴匶尸唺", num) : BookmarkStart.b("䜰娲䘴帶嬸场堼", num));
                }
                if (hashtable[0x3b9] != null)
                {
                    class14.method_2(BookmarkStart.b("尰䀲娴ᨶ丸䤺尼伾汀♂⅄⹆㵈⹊⥌", num), ((bool)hashtable[0x3b9]) ? "" : BookmarkStart.b("地", num));
                }
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ丸䤺尼伾汀❂ⱄ㑆㵈⩊⍌ⱎ㑐繒㥔㉖㽘⽚", num), Class734.smethod_18(hashtable[900], A_0.IsTopLevel));
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ丸䤺尼伾汀❂ⱄ㑆㵈⩊⍌ⱎ㑐繒⅔㡖⥘", num), Class734.smethod_18(hashtable[0x385], A_0.IsTopLevel));
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ丸䤺尼伾汀❂ⱄ㑆㵈⩊⍌ⱎ㑐繒❔㹖㹘㍚⥜", num), Class734.smethod_18(hashtable[0x386], A_0.IsTopLevel));
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ丸䤺尼伾汀❂ⱄ㑆㵈⩊⍌ⱎ㑐繒㝔㡖ⵘ⽚㉜㉞", num), Class734.smethod_18(hashtable[0x387], A_0.IsTopLevel));
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ䤸吺丼嘾㕀⩂⩄⥆摈⍊≌㵎㡐⥒㩔㥖ⵘ㩚ㅜ", num), (string)hashtable[0x38f]);
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ䤸吺丼嘾㕀⩂⩄⥆摈⍊≌㵎㡐⥒㩔㥖ⵘ㩚ㅜ牞፠٢।٦ᵨɪ᭬੮", num), (string)hashtable[0x390]);
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ䤸吺丼嘾㕀⩂⩄⥆摈㵊⡌㵎═㩒㙔㙖㕘", num), (string)hashtable[0x391]);
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ䤸吺丼嘾㕀⩂⩄⥆摈㵊⡌㵎═㩒㙔㙖㕘癚⽜㩞ൠɢᅤ๦Ὠ๪", num), (string)hashtable[0x392]);
                if (A_3.imethod_7())
                {
                    class14.method_2(BookmarkStart.b("尰䀲娴ᨶ唸帺嬼䬾汀㍂⁄㕆⩈⹊⍌㭎", num), (string)hashtable[0x7c2]);
                    class14.method_2(BookmarkStart.b("尰䀲娴ᨶ䴸吺䴼ሾㅀ♂㝄⑆ⱈ╊㥌", num), (string)hashtable[0x7c3]);
                    class14.method_2(BookmarkStart.b("尰䀲娴ᨶ丸刺夼䬾⥀湂㕄≆㭈⡊⡌ⅎ═", num), (string)hashtable[0x7c0]);
                    class14.method_2(BookmarkStart.b("尰䀲娴ᨶ儸帺吼堾⥀㝂桄㝆ⱈ㥊⹌⩎㽐❒", num), (string)hashtable[0x7c1]);
                    class14.method_2(BookmarkStart.b("尰䀲娴ᨶ丸刺夼䬾⥀湂㝄≆╈⩊㥌♎❐㙒", num), (string)hashtable[0x7c4]);
                    class14.method_2(BookmarkStart.b("尰䀲娴ᨶ儸帺吼堾⥀㝂桄㕆ⱈ❊ⱌ㭎㡐╒ご", num), (string)hashtable[0x7c5]);
                }
                class14.method_2(BookmarkStart.b("尰䀲娴ᨶ丸䤺尼伾汀あㅄ㹆╈⹊", num), (string)hashtable[0x85]);
                class14.method_2(BookmarkStart.b("䜰Ḳ䄴制䄸伺ြ帾⽀⁂ⵄ⡆㭈", num), (string)hashtable[0x87]);
                A_2.method_40(BookmarkStart.b("䈰䜲䰴嬶尸", num), Class734.smethod_2(class14));
            }
            if (hashtable[780] != null)
            {
                A_2.method_40(BookmarkStart.b("吰䈲䀴嘶䴸刺刼儾㥀⹂⥄", num), Encoding.UTF8.GetString((byte[])hashtable[780]));
            }
            A_2.method_38(BookmarkStart.b("䘰ल䄴弶尸嘺堼簾⹀⽂⩄㕆", num), hashtable[0x1033]);
            A_2.method_38(BookmarkStart.b("䘰ल䄴弶尸嘺堼氾⥀≂⅄≆", num), hashtable[0x1034]);
            A_2.method_38(BookmarkStart.b("䘰ल䄴弶尸嘺堼款⡀ⵂㅄ", num), hashtable[0x1035]);
            A_2.method_38(BookmarkStart.b("帰ल圴䀶吸吺夼娾", num), hashtable[0x304]);
            A_2.method_38(BookmarkStart.b("帰ल圴䀶䤸为似娾", num), hashtable[0x305]);
            A_2.method_38(BookmarkStart.b("帰ल圴䀶圸吺似刾⁀⽂", num), hashtable[0x306]);
            if (!A_1)
            {
                A_2.method_36(BookmarkStart.b("帰ल娴嬶尸刺帼倾⽀", num), hashtable[0x33a]);
            }
            if (A_0.IsInline && A_0.IsOle)
            {
                A_2.method_18(BookmarkStart.b("帰ल娴嬶尸", num), "");
            }
            if (A_0.IsInline)
            {
                A_2.method_40(BookmarkStart.b("帰ल圴堶䬸强堼䴾㕀ⱂ㕄⑆♈❊≌㵎", num), Class734.smethod_23((Class1031)hashtable[0x100a]));
                A_2.method_40(BookmarkStart.b("帰ल圴堶䬸强堼䴾ⵀ♂⍄㍆⩈⑊⅌⁎⍐", num), Class734.smethod_23((Class1031)hashtable[0x100b]));
                A_2.method_40(BookmarkStart.b("帰ल圴堶䬸强堼䴾⍀ⱂㅄ㍆♈♊⹌⁎㵐㱒❔", num), Class734.smethod_23((Class1031)hashtable[0x100c]));
                A_2.method_40(BookmarkStart.b("帰ल圴堶䬸强堼䴾㍀⩂≄⽆㵈⡊≌⍎㹐⅒", num), Class734.smethod_23((Class1031)hashtable[0x100d]));
            }
            switch (A_0.ShapeType)
            {
            case ShapeType.RoundRectangle:
                A_2.method_36(BookmarkStart.b("倰䄲嘴䐶倸䄺堼", num), Class734.smethod_10(smethod_7(A_0)));
                break;

            case ShapeType.Line:
                A_2.method_36(BookmarkStart.b("地䄲娴娶", num), Class734.smethod_17(A_0.Left, A_0.Top, A_0.IsTopLevel));
                A_2.method_36(BookmarkStart.b("䔰尲", num), Class734.smethod_17(A_0.Left + A_0.Width, A_0.Top + A_0.Height, A_0.IsTopLevel));
                break;
            }
            smethod_3(A_2, hashtable, 0x101d, 0x101e, BookmarkStart.b("到尲娴䔶崸吺似嘾♀⩂⭄", num));
            smethod_3(A_2, hashtable, 0x101f, 0x1020, BookmarkStart.b("到尲娴䔶崸䠺吼䔾⑀", num));
            A_2.method_35(BookmarkStart.b("帰ल吴嬶唸吺䨼嘾⽀⁂⁄⭆╈", num), hashtable[0x3b0], true);
            A_2.method_35(BookmarkStart.b("帰ल吴嬶唸吺䨼倾㝀♂㝄⭆⡈㭊", num), hashtable[950], true);
            if (A_0.ShapeType == ShapeType.CustomShape)
            {
                A_2.method_36(BookmarkStart.b("帰ल䘴䜶䴸", num), BookmarkStart.b("0̲Դ", num));
            }
            if (str3 != null)
            {
                A_2.method_40(BookmarkStart.b("帰ल儴倶吸场尼䘾⹀㙂ㅄ", num), str3);
            }
            if (str4 != null)
            {
                A_2.method_40(BookmarkStart.b("帰ल儴倶吸唺刼嬾⑀⡂ⱄ⥆ⵈ", num), str4);
            }
            A_2.method_36(BookmarkStart.b("帰ल嘴堶圸唺堼尾㕀ⱂ㝄㍆え㭊⡌", num), hashtable[0x303]);
            class7.method_1();
            class7.method_2();
            A_2.method_36(BookmarkStart.b("帰ल䔴䔶尸崺堼䴾㍀♂⥄♆㵈≊㭌⩎", num), hashtable[0x33b]);
            A_2.method_36(BookmarkStart.b("帰ल圴䈶䴸伺刼儾", num), hashtable[0x3bc]);
            A_2.method_36(BookmarkStart.b("帰ल崴䔶䤸堺䤼", num), hashtable[0x393]);
            A_2.method_36(BookmarkStart.b("帰ल崴䔶堸场吼堾⽀", num), hashtable[0x394]);
            A_2.method_36(BookmarkStart.b("帰ल崴䔶䨸伺夼", num), hashtable[0x3b2]);
            A_2.method_36(BookmarkStart.b("帰ल崴䔶圸吺丼圾⁀❂⁄", num), hashtable[0x3b3]);
            A_2.method_36(BookmarkStart.b("帰ल崴䔶", num), hashtable[0x3b4]);
            A_2.method_36(BookmarkStart.b("帰ल圴䈶唸场堼䬾", num), hashtable[0x3b1]);
            smethod_2(A_2, (Class891[])hashtable[0x383]);
            class3.method_1();
            if (!A_1)
            {
                class4.method_1();
            }
            class3.method_2();
            class4.method_2();
            class2.method_1();
            class5.method_1();
            class6.method_1();
            if (str == BookmarkStart.b("䜰ल䘴弶堸䬺堼", num))
            {
                class7.method_4();
                class7.method_5();
                class8.method_1();
                class7.method_10();
            }
            if (!A_1)
            {
                class9.method_1();
            }
            if (A_0.InkData != null)
            {
                A_2.method_4(BookmarkStart.b("帰ल尴夶券", num));
                A_2.method_44(BookmarkStart.b("堰", num), A_0.InkData);
                A_2.method_36(BookmarkStart.b("倰崲嬴堶䴸娺䤼嘾⹀ⵂ", num), A_0.InkAnnotation);
                A_2.method_5();
            }
            class12.method_1();
            class10.method_1();
            class11.method_1();
            smethod_6(BookmarkStart.b("䘰ȲԴശ嬸吺似嬾⑀ㅂㅄ⡆㥈", num), A_0.ShapePr[0x100a], A_2);
            smethod_6(BookmarkStart.b("䘰ȲԴശ嬸吺似嬾⑀ㅂ⥄≆⽈㽊", num), A_0.ShapePr[0x100b], A_2);
            smethod_6(BookmarkStart.b("䘰ȲԴശ嬸吺似嬾⑀ㅂ❄⡆㵈㽊≌≎", num), A_0.ShapePr[0x100c], A_2);
            smethod_6(BookmarkStart.b("䘰ȲԴശ嬸吺似嬾⑀ㅂ㝄⹆⹈⍊㥌", num), A_0.ShapePr[0x100d], A_2);
            bool flag2 = A_3.imethod_4().class335_0.Interface34.imethod_3(A_0.Id);
            if (!A_0.IsGroup && ((A_0.HasChildElements || flag2) || (A_0.ShapeType == ShapeType.TextBox)))
            {
                A_2.method_4(BookmarkStart.b("䜰ल䄴制䄸伺弼倾㥀", num));
                Class558 class15 = new Class558();
                if (hashtable.Contains(0x88))
                {
                    LayoutFlow flow = (LayoutFlow)hashtable[0x88];
                    if (flow == LayoutFlow.BottomToTop)
                    {
                        class15.method_2(BookmarkStart.b("崰刲䰴堶䰸伺ြ夾ⵀⱂ㉄", num), BookmarkStart.b("䜰嘲䜴䌶倸堺尼匾", num));
                        class15.method_2(BookmarkStart.b("尰䀲娴ᨶ唸娺䐼倾㑀㝂桄ⅆ╈⑊㩌扎ぐ㽒⅔", num), BookmarkStart.b("匰尲䄴䌶嘸嘺ြ䬾⹀湂ㅄ⡆㥈", num));
                    }
                    else
                    {
                        class15.method_2(BookmarkStart.b("崰刲䰴堶䰸伺ြ夾ⵀⱂ㉄", num), Class1085.smethod_46(flow));
                    }
                }
                int textboxNextShapeId = A_0.TextboxNextShapeId;
                if ((textboxNextShapeId != 0) && A_3.imethod_4().hashtable_0.ContainsKey(textboxNextShapeId))
                {
                    ShapeObject obj3 = (ShapeObject)A_3.imethod_4().hashtable_0[textboxNextShapeId];
                    string      str9 = Class567.smethod_16(obj3.Name) ? string.Format(BookmarkStart.b("ሰ䠲Դ䨶", num), obj3.Name) : string.Format(BookmarkStart.b("ሰ氲䴴ܶस଺഼怾㉀㡂畄㩆", num), textboxNextShapeId);
                    class15.method_2(BookmarkStart.b("尰䀲娴ᨶ圸帺䔼䬾汀㝂⁄㽆㵈⥊≌㝎", num), str9);
                }
                class15.method_2(BookmarkStart.b("尰䀲娴ᨶ弸刺䤼ሾ㉀⭂⑄㝆ⱈ晊㥌⁎籐❒ご⽖ⵘ", num), (string)hashtable[190]);
                A_2.method_36(BookmarkStart.b("䈰䜲䰴嬶尸", num), Class734.smethod_2(class15));
                A_2.method_36(BookmarkStart.b("堰崲䘴制䴸", num), Class734.smethod_8(hashtable));
                A_2.method_4(BookmarkStart.b("䘰ल䄴伶嬸䌺縼倾⽀㝂⁄⥆㵈", num));
                if (!A_0.HasChildElements && flag2)
                {
                    A_2.method_6(BookmarkStart.b("䘰ल䄴伶嬸䌺縼倾⽀㝂⁄⥆㵈", num));
                    A_2.method_6(BookmarkStart.b("䜰ल䄴制䄸伺弼倾㥀", num));
                }
            }
        }
    }