示例#1
0
    private static void smethod_3(Class581 A_0, CharacterFormat A_1)
    {
        Class394 class2 = A_0.imethod_1();

        if (!(class2.method_57() is MergeField) && (class2.method_57() != null))
        {
            FieldMark mark = new FieldMark(A_0.Interface50.imethod_0(), A_1, FieldMarkType.FieldEnd);
            A_0.method_9(mark);
            if (class2.method_52().Count == 0)
            {
                return;
            }
            Field field2 = class2.method_57();
            field2.End = mark;
            if ((class2.method_52().Count > 0) && (class2.method_53() == FieldCharType.Seperate))
            {
                class2.method_52().Pop();
            }
            if (class2.method_52().Count == 0)
            {
                field2.method_19();
                return;
            }
            class2.method_52().Pop();
            smethod_4(A_0, field2);
        }
        if ((class2.method_54() != null) && (class2.method_54().Count > 0))
        {
            Field field = class2.method_54().Pop();
            field.ParseFieldCode(field.Code);
            if ((field.Type == FieldType.FieldDate) || (field.Type == FieldType.FieldTime))
            {
                field.method_49();
            }
        }
    }
示例#2
0
        private void Setup()
        {
            #region "PAGE SETUP"
            s.PageSetup.PageSize       = PageSize.A4;
            s.PageSetup.Orientation    = PageOrientation.Portrait;
            s.PageSetup.Margins.Top    = 100.0f;
            s.PageSetup.Margins.Bottom = 72.0f;
            //s.PageSetup.Margins.Left = 89.85f;
            //s.PageSetup.Margins.Right = 89.85f;
            #endregion

            #region "FONT FORMAT"
            format                = new CharacterFormat(doc);
            format.FontName       = fontName;
            format.FontSize       = 15;
            format.Bold           = false;
            format.UnderlineStyle = UnderlineStyle.Single;
            bodyFormat            = new CharacterFormat(doc);
            bodyFormat.FontName   = fontName;
            bodyFormat.FontSize   = fontSize;
            bodyFormat.Bold       = false;
            //format2.UnderlineStyle = UnderlineStyle.Single;
            #endregion
        }
示例#3
0
    private void method_10(ParagraphFormat A_0)
    {
        this.class764_0.method_43().imethod_10();
        int             num    = this.class985_0.method_2();
        CharacterFormat format = null;

        for (int i = 0; i < this.class985_0.Count; i++)
        {
            Class537 class2 = this.class985_0.method_0(i);
            int      index  = 0;
            while (index < class2.method_2().Length)
            {
                Class1107 class3;
                char      ch1  = class2.method_2()[index];
                int       num4 = class2.method_1(index);
                int       num5 = this.class764_0.method_38(num4, class2.method_3().method_0().method_1(), out format, out class3);
                if (num5 == num4)
                {
                    break;
                }
                int num6 = num5 - num4;
                if (num6 < (class2.method_7() ? 2 : 1))
                {
                    num6 = class2.method_7() ? 2 : 1;
                }
                int num7 = num6 >> ((class2.method_7() != null) ? 1 : 0);
                int num8 = class2.method_2().Length - index;
                num7 = (num7 > num8) ? num8 : num7;
                bool flag = num == num7;
                this.method_14(format, class3, class2, index, ref num7, flag);
                index += num7;
                num   -= num7;
            }
        }
        this.class764_0.method_43().imethod_11(A_0, format);
    }
示例#4
0
 private void method_114(CharacterFormat A_0, CharacterFormat A_1)
 {
     if ((A_0 != null) && (A_1 != null))
     {
         if (A_0.HasValue(190))
         {
             A_1.FontSize = A_0.FontSize;
         }
         if (A_0.HasValue(160))
         {
             A_1.method_55(A_0.TextColor);
         }
         if (A_0.HasValue(230))
         {
             A_1.FontNameAscii = A_0.FontNameAscii;
         }
         if (A_0.HasValue(270))
         {
             A_1.FontNameBidi = A_0.FontNameBidi;
         }
         if (A_0.HasValue(0xeb))
         {
             A_1.FontNameFarEast = A_0.FontNameFarEast;
         }
         if (A_0.HasValue(240))
         {
             A_1.FontNameNonFarEast = A_0.FontNameNonFarEast;
         }
         if (A_0.HasValue(60))
         {
             A_1.Bold = A_0.Bold;
         }
         if (A_0.HasValue(70))
         {
             A_1.Italic = A_0.Italic;
         }
         if (A_0.HasValue(140))
         {
             A_1.UnderlineStyle = A_0.UnderlineStyle;
         }
         if (A_0.HasValue(20))
         {
             A_1.HighlightColor = A_0.HighlightColor;
         }
         if (A_0.HasValue(100))
         {
             A_1.IsShadow = A_0.IsShadow;
         }
         if (A_0.HasValue(150))
         {
             A_1.CharacterSpacing = A_0.CharacterSpacing;
         }
         if (A_0.HasValue(200))
         {
             A_1.Position = A_0.Position;
         }
         if (A_0.HasValue(300))
         {
             A_1.DoubleStrike = A_0.DoubleStrike;
         }
         if (A_0.HasValue(170))
         {
             A_1.Emboss = A_0.Emboss;
         }
         if (A_0.HasValue(180))
         {
             A_1.Engrave = A_0.Engrave;
         }
         if (A_0.HasValue(210))
         {
             A_1.SubSuperScript = A_0.SubSuperScript;
         }
         if (A_0.HasValue(9))
         {
             A_1.TextBackgroundColor = A_0.TextBackgroundColor;
         }
         if (A_0.HasValue(120))
         {
             A_1.AllCaps = A_0.AllCaps;
         }
         if (A_0.Bidi)
         {
             A_1.Bidi         = true;
             A_1.FontNameBidi = A_0.FontNameBidi;
             A_1.FontSizeBidi = A_0.FontSizeBidi;
         }
         if (A_0.HasValue(250))
         {
             A_1.BoldBidi = A_0.BoldBidi;
         }
         if (A_0.HasValue(0x6d))
         {
             A_1.FieldVanish = A_0.FieldVanish;
         }
         if (A_0.HasValue(130))
         {
             A_1.Hidden = A_0.Hidden;
         }
         if (A_0.HasValue(110))
         {
             A_1.IsSmallCaps = A_0.IsSmallCaps;
         }
         if (!A_1.HasValue(140))
         {
             A_1.UnderlineStyle = UnderlineStyle.None;
         }
     }
 }
示例#5
0
 public Class560(CharacterFormat A_0)
 {
     this.characterFormat_0 = A_0;
     this.string_0          = BookmarkStart.b("攰娲場制䨸ᬺ猼娾㙀捂ᝄ⡆⑈⩊⍌", 11);
 }
示例#6
0
 internal bool method_3(IRunAttrSource A_0, CharacterFormat A_1)
 {
     return(this.method_4(A_0, A_1, false));
 }
示例#7
0
 internal void method_14(CharacterFormat A_0)
 {
     this.characterFormat_0 = A_0;
 }
示例#8
0
        public static void CreatePdf()
        {
            // Set a name to our pdf file.
            string pdfPath = @"Result.pdf";

            // Let's create a simple PDF document.
            DocumentCore dc = new DocumentCore();
            //DocumentCore.Serial = "put your serial here";

            // Add new section.
            Section section = new Section(dc);

            dc.Sections.Add(section);

            // Let's set page size A4.
            section.PageSetup.PaperType = PaperType.A4;

            // Add two paragraphs using different ways:

            // Way 1: Add 1st paragraph.
            Paragraph par1 = new Paragraph(dc);

            par1.ParagraphFormat.Alignment = HorizontalAlignment.Center;
            section.Blocks.Add(par1);

            // Let's create a characterformat for text in the 1st paragraph.
            CharacterFormat cf = new CharacterFormat()
            {
                FontName = "Verdana", Size = 16, FontColor = Color.Orange
            };

            Run text1 = new Run(dc, "This is a first line in 1st paragraph!");

            text1.CharacterFormat = cf;
            par1.Inlines.Add(text1);

            // Let's add a line break into our paragraph.
            par1.Inlines.Add(new SpecialCharacter(dc, SpecialCharacterType.LineBreak));

            Run text2 = text1.Clone();

            text2.Text = "Let's type a second line.";
            par1.Inlines.Add(text2);

            // Way 2 (easy): Add 2nd paragraph using ContentRange.
            dc.Content.End.Insert("\nThis is a first line in 2nd paragraph.", new CharacterFormat()
            {
                Size = 25, FontColor = Color.Blue, Bold = true
            });
            SpecialCharacter lBr = new SpecialCharacter(dc, SpecialCharacterType.LineBreak);

            dc.Content.End.Insert(lBr.Content);
            dc.Content.End.Insert("This is a second line.", new CharacterFormat()
            {
                Size = 20, FontColor = Color.DarkGreen, UnderlineStyle = UnderlineType.Single
            });

            // Save PDF to a file
            dc.Save(pdfPath, new PdfSaveOptions());
            ShowResult(pdfPath);
        }
示例#9
0
    internal static CharacterFormat smethod_0(Class857 A_0, Class96 A_1)
    {
        int             num    = 1;
        Class396        class2 = A_0.method_11();
        CharacterFormat format = new CharacterFormat(A_0.method_9());
        string          str    = class2.method_12(BookmarkStart.b("䄦䘨䔪夬Ȯ䈰娲伴制", 1), BookmarkStart.b("ᘦᤨ嬪夬", 1));

        if (str.EndsWith(BookmarkStart.b("Ȧ", 1)))
        {
            str = BookmarkStart.b("ᘦᤨ嬪夬", num);
        }
        float    num3   = Class576.smethod_68(str);
        string   str3   = "";
        string   str4   = "";
        string   str5   = "";
        string   str6   = "";
        string   str7   = "";
        string   str8   = "";
        string   str12  = "";
        string   str9   = "";
        string   str10  = "";
        string   str13  = "";
        Color    black  = Color.Black;
        Class340 class3 = null;
        bool     flag   = true;
        string   str14  = string.Empty;
        string   str15  = string.Empty;
        bool     flag2  = false;
        bool     flag3  = false;

        class2.method_18();
        while (class2.method_19())
        {
            int      num2;
            string[] strArray;
            bool     flag4;
            string   str2 = class2.method_3();
            string   key  = class2.method_1();
            if (key != null)
            {
                int num4;
                if (Class1160.dictionary_231 == null)
                {
                    Dictionary <string, int> dictionary1 = new Dictionary <string, int>(0x2b);
                    dictionary1.Add(BookmarkStart.b("伦倨嬪䔬䨮弰刲䄴制", num), 0);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䜰刲䜴帶堸唺䤼", num), 1);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䔰䄲吴夶䨸崺刼䴾ⱀ", num), 2);
                    dictionary1.Add(BookmarkStart.b("䐦䘨䜪䈬崮", num), 3);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ帰䘲䄴嬶倸唺堼", num), 4);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ崰娲嬴制ᐸ伺唼䴾⹀㙂≄⽆摈㽊㑌㽎㑐", num), 5);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ崰娲嬴制ᐸ伺唼䴾⹀㙂≄⽆摈㱊⑌⭎═㭒", num), 6);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ崰娲嬴制ᐸ伺唼䴾⹀㙂≄⽆摈㡊㥌㙎㵐㙒", num), 7);
                    dictionary1.Add(BookmarkStart.b("䬦䰨弪夬䨮䌰Ḳ帴制䬸唺吼儾♀", num), 8);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䄰尲䘴帶䴸刺刼儾", num), 9);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ弰刲場制", num), 10);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ弰刲場制ᐸ堺刼刾ㅀ⽂⁄㽆", num), 11);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ弰刲場制ᐸ娺丼嘾⁀ⵂ", num), 12);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䈰娲伴制", num), 13);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䈰娲伴制ᐸ娺丼嘾⁀ⵂ", num), 14);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䈰娲伴制ᐸ堺刼刾ㅀ⽂⁄㽆", num), 15);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䘰嘲尴倶儸伺", num), 0x10);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䘰嘲尴倶儸伺ြ帾㉀⩂⑄⥆", num), 0x11);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䘰嘲尴倶儸伺ြ尾⹀⹂㕄⭆ⱈ㍊", num), 0x12);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䈰䜲䰴嬶尸", num), 0x13);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䈰䜲䰴嬶尸ᘺ尼䰾⡀≂⭄", num), 20);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䈰䜲䰴嬶尸ᘺ帼倾ⱀ㍂⥄≆ㅈ", num), 0x15);
                    dictionary1.Add(BookmarkStart.b("䬦䠨䔪䨬娮倰吲倴", num), 0x16);
                    dictionary1.Add(BookmarkStart.b("䐦䘨帪䌬嬮䌰䨲", num), 0x17);
                    dictionary1.Add(BookmarkStart.b("䬦䠨䔪䨬娮倰吲倴ᨶ堸䠺吼帾⽀", num), 0x18);
                    dictionary1.Add(BookmarkStart.b("䐦䘨帪䌬嬮䌰䨲ᠴ嘶䨸刺尼儾", num), 0x19);
                    dictionary1.Add(BookmarkStart.b("䬦䠨䔪䨬娮倰吲倴ᨶ娸吺值伾ⵀ♂㵄", num), 0x1a);
                    dictionary1.Add(BookmarkStart.b("䐦䘨帪䌬嬮䌰䨲ᠴ吶嘸嘺䴼匾⑀㭂", num), 0x1b);
                    dictionary1.Add(BookmarkStart.b("䔦䠨䠪䘬䠮䌰尲䀴夶崸ᘺ帼倾ⵀⱂ㝄", num), 0x1c);
                    dictionary1.Add(BookmarkStart.b("䬦䰨弪夬䨮䌰Ḳ䘴䜶堸堺吼儾♀", num), 0x1d);
                    dictionary1.Add(BookmarkStart.b("䄦䘨䔪夬Ȯ䌰嘲头帶尸崺", num), 30);
                    dictionary1.Add(BookmarkStart.b("䌦䀨堪崬䌮倰䨲", num), 0x1f);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ匰弲尴夶券刺匼堾", num), 0x20);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䈰倲吴嬶尸", num), 0x21);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䈰嬲吴匶嘸䰺", num), 0x22);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䐰崲儴制䬸场吼儾⑀湂㉄⹆ⵈ㽊╌", num), 0x23);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䐰崲儴制䬸场吼儾⑀湂㙄㍆え❊⡌", num), 0x24);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䐰崲儴制䬸场吼儾⑀湂ㅄ㹆㥈⹊", num), 0x25);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䐰崲儴制䬸场吼儾⑀湂⡄⡆ⵈ⹊", num), 0x26);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䐰崲儴制䬸场吼儾⑀湂♄⡆╈⑊㽌", num), 0x27);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䌰尲䄴嘶䴸刺刼儾汀あ♄♆╈⹊", num), 40);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ䌰尲䄴嘶䴸刺刼儾汀≂⭄⁆╈⹊", num), 0x29);
                    dictionary1.Add(BookmarkStart.b("匦䰨匪夬Ȯ吰帲䔴弶堸䠺吼䔾⑀", num), 0x2a);
                    Class1160.dictionary_231 = dictionary1;
                }
                if (Class1160.dictionary_231.TryGetValue(key, out num4))
                {
                    switch (num4)
                    {
                    case 0:
                        goto Label_04F5;

                    case 1:
                        if (str2 == BookmarkStart.b("否䐨䨪䄬䌮ᰰ倲吴䜶䨸", num))
                        {
                            format.SetAttr(110, Class650.class650_1);
                        }
                        break;

                    case 2:
                        if (str2 == BookmarkStart.b("刦夨嬪䠬崮到刲䘴制", num))
                        {
                            format.SetAttr(120, Class650.class650_1);
                        }
                        break;

                    case 3:
                        format.SetAttr(160, Class576.smethod_76(str2));
                        break;

                    case 4:
                        if (str2 == BookmarkStart.b("匦嬨帪䠬", num))
                        {
                            format.SetAttr(90, Class650.class650_1);
                        }
                        break;

                    case 5:
                        goto Label_05F1;

                    case 6:
                        if (str2 == "")
                        {
                            flag = false;
                        }
                        break;

                    case 7:
                        if (!(str2 == BookmarkStart.b("否䘨䜪䐬䬮", num)))
                        {
                            goto Label_067D;
                        }
                        format.SetAttr(80, Class650.class650_1);
                        break;

                    case 8:
                        format.SetAttr(220, 1.5f);
                        if (str2 != BookmarkStart.b("匦嬨帪䠬", num))
                        {
                            format.SetAttr(220, 0f);
                        }
                        break;

                    case 9:
                        strArray = str2.Split(new char[] { ' ' });
                        if (!(strArray[0] == BookmarkStart.b("否尨嬪䠬崮", num)))
                        {
                            goto Label_072E;
                        }
                        format.SetAttr(210, SubSuperScript.SuperScript);
                        goto Label_0755;

                    case 10:
                    {
                        string str11 = (string)A_0.method_54()[class2.method_3()];
                        if (Class567.smethod_16(str11))
                        {
                            format.FontNameAscii      = str11;
                            format.FontNameNonFarEast = str11;
                        }
                        break;
                    }

                    case 11:
                    {
                        string str17 = (string)A_0.method_54()[class2.method_3()];
                        if (Class567.smethod_16(str17))
                        {
                            format.FontNameBidi = (string)A_0.method_54()[class2.method_3()];
                        }
                        break;
                    }

                    case 12:
                    {
                        string str16 = (string)A_0.method_54()[class2.method_3()];
                        if (Class567.smethod_16(str16))
                        {
                            format.FontNameFarEast = (string)A_0.method_54()[class2.method_3()];
                        }
                        break;
                    }

                    case 13:
                        Class576.smethod_66(class2.method_3(), A_1, format, 190);
                        break;

                    case 14:
                    case 15:
                        Class576.smethod_66(class2.method_3(), A_1, format, 350);
                        break;

                    case 0x10:
                        str14 = smethod_4(str2);
                        break;

                    case 0x11:
                        str15 = smethod_4(str2);
                        break;

                    case 0x12:
                        format.SetAttr(250, new Class650(Class576.smethod_70(class2.method_3())));
                        break;

                    case 0x13:
                        flag2 = Class576.smethod_69(class2.method_3());
                        break;

                    case 20:
                        flag3 = Class576.smethod_69(class2.method_3());
                        break;

                    case 0x15:
                        format.SetAttr(260, new Class650(Class576.smethod_69(class2.method_3())));
                        break;

                    case 0x16:
                        str3 = class2.method_3();
                        break;

                    case 0x17:
                        str4 = class2.method_3();
                        break;

                    case 0x18:
                        str5 = class2.method_3();
                        break;

                    case 0x19:
                        str6 = class2.method_3();
                        break;

                    case 0x1a:
                        str7 = class2.method_3();
                        break;

                    case 0x1b:
                        str8 = class2.method_3();
                        break;

                    case 0x1c:
                        format.SetAttr(370, Class576.smethod_62(str2, (Class16)format.method_31(370)));
                        break;

                    case 0x1d:
                        format.SetAttr(150, (class2.method_3() == BookmarkStart.b("䤦䘨太䀬丮崰", num)) ? 0f : (((float)Class576.smethod_36(class2.method_3())) / 20f));
                        break;

                    case 30:
                        goto Label_09A1;

                    case 0x1f:
                        goto Label_09F9;

                    case 0x20:
                        smethod_3(class2.method_3(), black);
                        break;

                    case 0x21:
                        format.SetAttr(290, smethod_2(class2.method_3()));
                        break;

                    case 0x22:
                        if (class2.method_3() != BookmarkStart.b("䤦䘨䔪䠬", num))
                        {
                            format.SetAttr(100, Class650.class650_1);
                        }
                        break;

                    case 0x23:
                        str12 = class2.method_3();
                        break;

                    case 0x24:
                        str9 = class2.method_3();
                        break;

                    case 0x25:
                        str13 = class2.method_3();
                        break;

                    case 0x26:
                        str10 = class2.method_3();
                        break;

                    case 0x27:
                        if (class2.method_3() != BookmarkStart.b("䄦䘨䔪夬Ȯ到尲头堶䬸", num))
                        {
                            format.SetAttr(450, Class576.smethod_76(class2.method_3()));
                        }
                        break;

                    case 40:
                        goto Label_0B20;

                    case 0x29:
                        goto Label_0B51;

                    case 0x2a:
                        format.SetAttr(770, smethod_5(str2));
                        break;
                    }
                }
            }
            continue;
Label_04F5:
            flag4 = str2 == BookmarkStart.b("匦嬨帪䠬", num);
            if ((A_1.method_4() == BookmarkStart.b("圦䠨太䰬䠮䌰刲䔴弶", num)) && (A_1.method_0() == null))
            {
                A_0.method_9().Settings.bool_27 = flag4;
            }
            A_1.method_15().SetAttr(0x582, !flag4);
            continue;
Label_05F1:
            if (str2 == BookmarkStart.b("䌦䘨帪伬䌮吰", num))
            {
                format.SetAttr(300, Class650.class650_1);
            }
            if (str2 == BookmarkStart.b("否䀨䔪䨬䌮吰", num))
            {
                format.SetAttr(80, Class650.class650_1);
            }
            continue;
Label_067D:
            if (str2 == BookmarkStart.b("䤦䘨䔪䠬", num))
            {
                format.SetAttr(80, Class650.class650_0);
            }
            continue;
Label_072E:
            if (strArray[0] == BookmarkStart.b("否尨䤪", num))
            {
                format.SetAttr(210, SubSuperScript.SubScript);
            }
Label_0755:
            format.SetAttr(200, Class576.smethod_73(format, str2, num3));
            continue;
Label_09A1:
            if (class2.method_3() == BookmarkStart.b("䈦䜨䰪弬丮䜰嘲儴", num))
            {
                format.SetAttr(180, Class650.class650_1);
            }
            if (class2.method_3() == BookmarkStart.b("䈦䐨䤪䈬尮䈰嘲儴", num))
            {
                format.SetAttr(170, Class650.class650_1);
            }
            continue;
Label_09F9:
            if (class2.method_3() == BookmarkStart.b("䤦䘨䔪䠬", num))
            {
                format.SetAttr(130, Class650.class650_1);
            }
            if (class2.method_3() == BookmarkStart.b("匦嬨帪䠬", num))
            {
                format.SetAttr(130, Class650.class650_0);
            }
            continue;
Label_0B20:
            if (class2.method_3() == BookmarkStart.b("䬦䀨䔪䠬Ȯ夰嘲尴倶儸伺", num))
            {
                if (class3 == null)
                {
                    class3 = smethod_1(A_0);
                }
                class3.method_7(true);
            }
            continue;
Label_0B51:
            num2 = Class1041.smethod_23(str2) % 360;
            if (((num2 >= 0x2d) && (num2 < 180)) || ((num2 >= -315) && (num2 < -180)))
            {
                if (class3 == null)
                {
                    class3 = smethod_1(A_0);
                }
                class3.method_1(true);
            }
            if (class3 == null)
            {
                A_1.method_20(Class922.smethod_70(class2.method_3()));
            }
        }
        if (!flag)
        {
            format.SetAttr(80, Class650.class650_0);
            format.SetAttr(300, Class650.class650_0);
        }
        if ((str14 != string.Empty) || (str15 != string.Empty))
        {
            if (!(str14 == BookmarkStart.b("匦嬨帪䠬", num)) && !(str15 == BookmarkStart.b("匦嬨帪䠬", num)))
            {
                format.SetAttr(60, Class650.class650_0);
            }
            else
            {
                format.SetAttr(60, Class650.class650_1);
            }
        }
        if (flag2 || flag3)
        {
            format.SetAttr(70, Class650.class650_1);
        }
        if (class3 != null)
        {
            format.SetAttr(780, class3);
        }
        format.SetAttr(380, (short)Class922.smethod_81(string.Format(BookmarkStart.b("尦ᤨ嘪,吮0串", num), str3, str4)));
        format.SetAttr(390, (short)Class922.smethod_81(string.Format(BookmarkStart.b("尦ᤨ嘪,吮0串", num), str5, str6)));
        format.SetAttr(340, (short)Class922.smethod_81(string.Format(BookmarkStart.b("尦ᤨ嘪,吮0串", num), str7, str8)));
        if ((Class567.smethod_16(str9) || (str10 == BookmarkStart.b("否䈨䈪崬Ȯ䘰嬲尴䌶尸ᘺ丼伾⁀⁂⁄", num))) || (str12 == BookmarkStart.b("匦䄨䈪丬䐮", num)))
        {
            format.SetAttr(140, Class922.smethod_68(str9, str12, str10, str13));
        }
        return(format);
    }
示例#10
0
        static void Main(string[] args)
        {
            Console.WriteLine("Programa de Nota Fiscal no Word");

            string clienteNome     = "";
            string clienteEndereco = "";
            double valorCompra     = 0;
            string dataCompra;

            Console.WriteLine("Por favor digite seu nome:");
            clienteNome = Console.ReadLine();

            Console.WriteLine("Por favor digite seu endereço:");
            clienteEndereco = Console.ReadLine();

            Console.WriteLine("Qual é o valor da compra?");
            valorCompra = double.Parse(Console.ReadLine());

            Console.WriteLine("Qual a data da compra?");
            dataCompra = DateTime.Parse(Console.ReadLine()).ToString("dd-MM-yyyy");

            //Criando um novo documento com o nome documento.
            Document documentoNotaFiscal = new Document();

            // Criando uma sessão dentro do documento.
            // A cada sessão criada, uma nova página é adicionada.
            Section secaoNotaFiscal = documentoNotaFiscal.AddSection();

            // Insere um título na primeira página.
            Paragraph paragrafoNotaFiscal = secaoNotaFiscal.AddParagraph();


            TextBox textBoxNota = paragrafoNotaFiscal.AppendTextBox(300, 100);

            textBoxNota.Format.VerticalOrigin     = VerticalOrigin.Margin;
            textBoxNota.Format.VerticalPosition   = 100;
            textBoxNota.Format.HorizontalOrigin   = HorizontalOrigin.Margin;
            textBoxNota.Format.HorizontalPosition = 100;
            textBoxNota.Format.NoLine             = true;



            TextBox textBox = paragrafoNotaFiscal.AppendTextBox(300, 600);

            textBox.Format.VerticalOrigin     = VerticalOrigin.Margin;
            textBox.Format.VerticalPosition   = 140;
            textBox.Format.HorizontalOrigin   = HorizontalOrigin.Margin;
            textBox.Format.HorizontalPosition = 50;
            textBox.Format.NoLine             = true;

            CharacterFormat formatoTitulos = new CharacterFormat(documentoNotaFiscal);

            formatoTitulos.FontName = "Comic Sans";
            formatoTitulos.FontSize = 18;
            formatoTitulos.Bold     = true;


            CharacterFormat formatoVariaveis = new CharacterFormat(documentoNotaFiscal);

            formatoVariaveis.FontName = "Comic Sans";
            formatoVariaveis.FontSize = 18;
            formatoVariaveis.Italic   = true;

            Paragraph tituloNotaFiscal = textBoxNota.Body.AddParagraph();

            tituloNotaFiscal.AppendText("Nota Fiscal").ApplyCharacterFormat(formatoTitulos);

            Paragraph tituloNome = textBox.Body.AddParagraph();

            tituloNome.AppendText("Nome: ").ApplyCharacterFormat(formatoTitulos);
            tituloNome.AppendText(clienteNome).ApplyCharacterFormat(formatoVariaveis);

            Paragraph tituloEndereco = textBox.Body.AddParagraph();

            tituloEndereco.AppendText("Endereço: ").ApplyCharacterFormat(formatoTitulos);
            tituloEndereco.AppendText(clienteEndereco).ApplyCharacterFormat(formatoVariaveis);

            Paragraph tituloValor = textBox.Body.AddParagraph();

            tituloValor.AppendText("Valor: ").ApplyCharacterFormat(formatoTitulos);
            tituloValor.AppendText($"R$ {valorCompra}").ApplyCharacterFormat(formatoVariaveis);

            Paragraph tituloData = textBox.Body.AddParagraph();

            tituloData.AppendText("Data Compra: ").ApplyCharacterFormat(formatoTitulos);
            tituloData.AppendText(dataCompra).ApplyCharacterFormat(formatoVariaveis);


            documentoNotaFiscal.SaveToFile(@"Arquivo\notafiscal.docx", FileFormat.Docx);
        }
示例#11
0
    private static void smethod_8(Class581 A_0, CharacterFormat A_1)
    {
        int      num    = 6;
        Class394 class2 = A_0.imethod_1();
        string   str    = class2.method_1();
        bool     flag   = (A_0.method_22() || (class2.method_12(BookmarkStart.b("弫席儯儱儳", num), "") == BookmarkStart.b("尫尭唯䄱儳䐵丷弹", num))) || (str != BookmarkStart.b("堫", num));

        while (class2.method_10(str, XmlDocumentTextHandling.TextAndSignificant))
        {
            string str2 = class2.method_1();
            if (str2 != null)
            {
                if (str2 == "")
                {
                    string str3 = class2.method_3().Replace(Class816.string_4, Class816.string_11);
                    str3.TrimStart(new char[] { '\n' });
                    str3 = str3.Replace(Class816.string_3, Class816.string_11);
                    if (!flag)
                    {
                        str3 = str3.Trim(char_0).Replace('\t', ' ');
                    }
                    if (smethod_9(str3))
                    {
                        smethod_14(A_0, A_1, str3[0]);
                    }
                    else if (!smethod_10(str3))
                    {
                        class2.method_51().Append(str3);
                    }
                }
                else if (str2 != BookmarkStart.b("䈫䄭爯䀱儳圵匷爹䔻丽⠿❁⩃", num))
                {
                    if (str2 != BookmarkStart.b("丫尭", num))
                    {
                        if (!(str2 == BookmarkStart.b("尫", num)))
                        {
                            if (!(str2 == BookmarkStart.b("堫䰭尯", num)))
                            {
                                goto Label_01A5;
                            }
                            smethod_12(A_0);
                        }
                        else
                        {
                            smethod_13(A_0);
                        }
                    }
                    else
                    {
                        class2.method_51().Append(Class816.string_6);
                    }
                }
                else
                {
                    class2.method_51().Append(Class816.string_12);
                }
                continue;
            }
Label_01A5:
            smethod_11(A_0, A_1);
        }
    }
示例#12
0
    private static void smethod_6(Class581 A_0, CharacterFormat A_1)
    {
        Class394 class2 = A_0.imethod_1();
        string   str    = class2.method_1();

        while (class2.method_10(str, XmlDocumentTextHandling.TextAndSignificant))
        {
            string str2 = class2.method_3();
            switch (str2)
            {
            case null:
            case string.Empty:
                return;
            }
            Field field = smethod_7(str2, A_0.Interface50.imethod_0());
            if (!class2.bool_0 && (class2.method_57() != null))
            {
                int index = -1;
                if ((class2.method_57() != null) && (class2.method_57().NextSibling == null))
                {
                    index = (A_0.method_13() as Paragraph).ChildObjects.IndexOf(class2.method_57());
                }
                if (((class2.method_53() != FieldCharType.Seperate) && (index >= 0)) && (index == ((A_0.method_13() as Paragraph).ChildObjects.Count - 1)))
                {
                    Field field3 = class2.method_57();
                    field3.Code = field3.Code + str2;
                    if (class2.method_57().Type == FieldType.FieldUnknown)
                    {
                        Field field2 = class2.method_54().Pop();
                        (A_0.method_13() as Paragraph).method_20(field2);
                        field2 = smethod_7(field2.Code, A_0.Interface50.imethod_0());
                        if (A_1 != null)
                        {
                            field2.ApplyCharacterFormat(A_1);
                        }
                        field2.IsLocked = class2.method_55();
                        class2.method_56(false);
                        A_0.method_9(field2);
                        if (class2.method_57() != field2)
                        {
                            class2.method_54().Push(field2);
                        }
                    }
                }
                else
                {
                    TextRange range = new TextRange(A_0.Interface50.imethod_0());
                    if (A_1 != null)
                    {
                        range.ApplyCharacterFormat(A_1);
                    }
                    range.Text = str2;
                    A_0.method_9(range);
                }
                return;
            }
            if (A_1 != null)
            {
                field.CharacterFormat.method_73(A_1);
            }
            field.IsLocked = class2.method_55();
            class2.method_56(false);
            A_0.method_9(field);
            class2.method_54().Push(field);
        }
    }
示例#13
0
 private static void smethod_23(Class581 A_0, CharacterFormat A_1)
 {
 }
示例#14
0
 private static void smethod_22(Class581 A_0, CharacterFormat A_1)
 {
     smethod_4(A_0, A_1);
     Class250.smethod_0(A_0, A_1);
 }
示例#15
0
 private static void smethod_21(Class581 A_0, CharacterFormat A_1)
 {
     smethod_4(A_0, A_1);
 }
示例#16
0
 public Class6(Stream A_0, IDocument A_1) : base(A_1 as Document)
 {
     this.stream_0          = A_0;
     this.characterFormat_0 = new CharacterFormat(A_1);
 }
示例#17
0
    internal static bool smethod_10(Class857 A_0, DocumentObject A_1, CharacterFormat A_2, Style A_3)
    {
        int num = 3;

        if (!(A_1 is ShapeObject) || (A_1 is ShapeGroup))
        {
            Class396       class3        = A_0.method_11();
            DocumentObject lastParagraph = A_1;
            string         str3          = class3.method_0();
            string         str           = class3.method_1();
            if ((A_1 is Body) && (((str3 == BookmarkStart.b("䴨太䰬堮", num)) && (str == BookmarkStart.b("䠨", num))) || (((((str == BookmarkStart.b("丨", num)) || (str == BookmarkStart.b("䔨䈪䌬䨮", num))) || ((str == BookmarkStart.b("䨨䐪䌬䄮吰倲䄴堶䬸", num)) || (str == BookmarkStart.b("嬨个丬嬮", num)))) || (((str == BookmarkStart.b("䨨䈪弬䰮崰嘲", num)) || (str == BookmarkStart.b("䰨䜪䄬䘮䄰䀲倴", num))) || ((str == BookmarkStart.b("夨䐪䄬嘮崰娲嬴制", num)) || (str == BookmarkStart.b("夨䐪䄬嘮嘰尲嬴", num))))) || ((((str == BookmarkStart.b("嬨个䨬娮崰刲䜴ᨶ䤸吺儼䘾♀ⱂ⭄", num)) || (str == BookmarkStart.b("夨䨪夬䜮", num))) || ((str == BookmarkStart.b("夨䨪䨬䨮ᰰ䜲崴䈶吸夺匼帾⡀⽂", num)) || (str == BookmarkStart.b("䐨个䰬尮䐰䄲倴", num)))) || (((str == BookmarkStart.b("䨨䨪崬嬮堰尲嬴", num)) || (str == BookmarkStart.b("娨䠪䠬䄮吰", num))) || (str == BookmarkStart.b("䨨帪帬嬮帰帲ᠴ䐶儸娺䴼娾", num)))))))
            {
                if (A_0.method_36().Count == 0)
                {
                    Body body = (Body)A_1;
                    if (body.LastParagraph == null)
                    {
                        body.method_13(new Paragraph(A_0.method_9()));
                        A_0.method_36().Add(body.LastParagraph);
                    }
                    lastParagraph = (DocumentObject)body.LastParagraph;
                }
                else
                {
                    lastParagraph = (Paragraph)A_0.method_36()[A_0.method_36().Count - 1];
                }
            }
            string key = class3.method_1();
            if (key != null)
            {
                int num2;
                if (Class1160.dictionary_174 == null)
                {
                    Dictionary <string, int> dictionary1 = new Dictionary <string, int>(0x12);
                    dictionary1.Add(BookmarkStart.b("丨", num), 0);
                    dictionary1.Add(BookmarkStart.b("䠨", num), 1);
                    dictionary1.Add(BookmarkStart.b("伨太䰬䈮吰", num), 2);
                    dictionary1.Add(BookmarkStart.b("䨨䐪䌬嬮䌰尲头", num), 3);
                    dictionary1.Add(BookmarkStart.b("䔨䈪䌬䨮", num), 4);
                    dictionary1.Add(BookmarkStart.b("䨨䐪䌬䄮吰倲䄴堶䬸", num), 5);
                    dictionary1.Add(BookmarkStart.b("嬨个丬嬮", num), 6);
                    dictionary1.Add(BookmarkStart.b("䨨䈪弬䰮崰嘲", num), 7);
                    dictionary1.Add(BookmarkStart.b("䰨䜪䄬䘮䄰䀲倴", num), 8);
                    dictionary1.Add(BookmarkStart.b("䨨帪帬嬮帰帲ᠴ䐶儸娺䴼娾", num), 9);
                    dictionary1.Add(BookmarkStart.b("夨䐪䄬嘮崰娲嬴制", num), 10);
                    dictionary1.Add(BookmarkStart.b("夨䐪䄬嘮嘰尲嬴", num), 11);
                    dictionary1.Add(BookmarkStart.b("夨䨪夬䜮", num), 12);
                    dictionary1.Add(BookmarkStart.b("嬨个䨬娮崰刲䜴ᨶ䤸吺儼䘾♀ⱂ⭄", num), 13);
                    dictionary1.Add(BookmarkStart.b("夨䨪䨬䨮ᰰ䜲崴䈶吸夺匼帾⡀⽂", num), 14);
                    dictionary1.Add(BookmarkStart.b("䐨个䰬尮䐰䄲倴", num), 15);
                    dictionary1.Add(BookmarkStart.b("䨨䨪崬嬮堰尲嬴", num), 0x10);
                    dictionary1.Add(BookmarkStart.b("娨䠪䠬䄮吰", num), 0x11);
                    Class1160.dictionary_174 = dictionary1;
                }
                if (Class1160.dictionary_174.TryGetValue(key, out num2))
                {
                    switch (num2)
                    {
                    case 0:
                        Class745.smethod_0(A_0, lastParagraph, A_2);
                        return(true);

                    case 1:
                        return(smethod_11(A_0, lastParagraph));

                    case 2:
                        Class746.smethod_0(A_0, lastParagraph, A_2);
                        return(true);

                    case 3:
                        Class1144.smethod_0(A_0, lastParagraph, A_2, A_3);
                        return(true);

                    case 4:
                        Class244.smethod_0(A_0, lastParagraph, A_2);
                        return(true);

                    case 5:
                        Class245.smethod_0(A_0, lastParagraph, A_2);
                        return(true);

                    case 6:
                        A_0.method_56(true);
                        Class1051.smethod_0(A_0, lastParagraph, A_2);
                        A_0.method_56(false);
                        return(true);

                    case 7:
                    case 8:
                        A_0.method_56(true);
                        Class473.smethod_0(A_0, lastParagraph, A_2);
                        A_0.method_56(false);
                        return(true);

                    case 9:
                    case 10:
                    case 11:
                    {
                        A_0.method_56(true);
                        Class1097 class2 = new Class1097();
                        class2.method_23(class3.method_1() == BookmarkStart.b("夨䐪䄬嘮崰娲嬴制", num));
                        class2.method_0(A_0, lastParagraph, A_2);
                        A_0.method_56(false);
                        return(true);
                    }

                    case 12:
                        A_0.method_56(true);
                        new Class1143().method_0(A_0, lastParagraph, A_2);
                        A_0.method_56(false);
                        return(true);

                    case 14:
                    case 15:
                    case 0x10:
                    case 0x11:
                        return(true);
                    }
                }
            }
        }
        return(false);
    }
示例#18
0
        static void Main(string[] args)
        {
            XmlTextReader reader = new XmlTextReader(Template.PathXml);

            XmlTag top    = new XmlTag("XML");
            XmlTag target = top;

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                case XmlNodeType.Element:
                    target = target.CreateChild(reader.Name);
                    break;

                case XmlNodeType.Text:
                    target.Text = reader.Value;
                    break;

                case XmlNodeType.EndElement:
                    target = target.Parent;
                    break;
                }
            }
            top = top.Childs[0];


            docx = new DocumentCore();

            // Add a new section
            section = new Section(docx);
            section.PageSetup.PageWidth   = LengthUnitConverter.Convert(8.5, LengthUnit.Inch, LengthUnit.Point);
            section.PageSetup.PageHeight  = LengthUnitConverter.Convert(11.0, LengthUnit.Inch, LengthUnit.Point);
            section.PageSetup.Orientation = Orientation.Portrait;
            section.PageSetup.PageMargins = new PageMargins()
            {
                Top    = LengthUnitConverter.Convert(.5f, LengthUnit.Inch, LengthUnit.Point),
                Right  = LengthUnitConverter.Convert(.5f, LengthUnit.Inch, LengthUnit.Point),
                Bottom = LengthUnitConverter.Convert(.5f, LengthUnit.Inch, LengthUnit.Point),
                Left   = LengthUnitConverter.Convert(.5f, LengthUnit.Inch, LengthUnit.Point)
            };

            docx.Sections.Add(section);
            docx.Styles.Add(Template.StyleBullet);

            Table table = new Table(docx);

            table.TableFormat.PreferredWidth = new TableWidth(100, TableWidthUnit.Percentage);
            section.Blocks.Add(table);

            Config config = new Config(top.Childs[0]);

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            table.Rows.Add(new ContentName().Content(docx));
            table.Rows.Add(new ContentContact(top.Childs[1].Childs).Content(docx));
            table.Rows.Add(new TableRow(docx, new TableCell(docx, Template.LineBreak(docx))));

            if (config.Summary != null)
            {
                table.Rows.Add(new ContentHeading().Content(docx, "SUMMARY"));
                table.Rows.Add(new ContentSummary(top.Childs[2].Childs, config.Summary).Content(docx));
                table.Rows.Add(new TableRow(docx, new TableCell(docx, Template.LineBreak(docx))));
            }

            if (config.Experience != null)
            {
                table.Rows.Add(new ContentHeading().Content(docx, "WORK AND RELATED EXPERIENCE"));//////////////////////////////////////////////////////////////
                foreach (TableRow item in new ContentExperience(top.Childs[3].Childs, config.Experience).Content(docx, true))
                {
                    table.Rows.Add(item);
                }
                table.Rows.Add(new TableRow(docx, new TableCell(docx, Template.LineBreak(docx))));
            }

            if (config.Education != null)
            {
                table.Rows.Add(new ContentHeading().Content(docx, "EDUCATION"));//////////////////////////////////////////////////////////////
                foreach (TableRow item in new ContentEducation(top.Childs[4].Childs, config.Education).Content(docx))
                {
                    table.Rows.Add(item);
                }
                table.Rows.Add(new TableRow(docx, new TableCell(docx, Template.LineBreak(docx))));
            }

            if (config.Skill != null)
            {
                table.Rows.Add(new ContentHeading().Content(docx, "SKILLS"));//////////////////////////////////////////////////////////////
                TableRow row = new TableRow(docx, new TableCell(docx), new TableCell(docx));
                table.Rows.Add(row);
                foreach (TableCell cell in row.Cells)
                {
                    cell.CellFormat.PreferredWidth = new TableWidth(50, TableWidthUnit.Auto);
                    cell.ColumnSpan = 1;
                }

                List <Table> area = new ContentSkill(top.Childs[6].Childs, config.Skill, 4).Content(docx);
                for (int i = 0; i < area.Count; i++)
                {
                    if (i - 1 < ContentSkill.breakNumber)
                    {
                        row.Cells[0].Blocks.Add(area[i]);
                    }
                    else
                    {
                        row.Cells[1].Blocks.Add(area[i]);
                    }
                }
                table.Rows.Add(new TableRow(docx, new TableCell(docx, Template.LineBreak(docx))));
            }

            if (config.Award != null)
            {
                table.Rows.Add(new ContentHeading().Content(docx, "AWARDS AND HONOURS"));//////////////////////////////////////////////////////////////
                foreach (TableRow item in new ContentAwards(top.Childs[5].Childs, config.Award).Content(docx))
                {
                    table.Rows.Add(item);
                }
                table.Rows.Add(new TableRow(docx, new TableCell(docx, Template.LineBreak(docx))));
            }

            if (config.Volunteer != null)
            {
                table.Rows.Add(new ContentHeading().Content(docx, "VOLUNTEER ACTIVITIES"));//////////////////////////////////////////////////////////////
                foreach (TableRow item in new ContentExperience(top.Childs[7].Childs, config.Volunteer).Content(docx, false))
                {
                    table.Rows.Add(item);
                }
                table.Rows.Add(new TableRow(docx, new TableCell(docx, Template.LineBreak(docx))));
            }


            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            HeaderFooter footer = new HeaderFooter(docx, HeaderFooterType.FooterDefault);

            // Create a new paragraph to insert a page numbering.
            // So that, our page numbering looks as: Page N of M.
            Paragraph par = new Paragraph(docx);

            par.ParagraphFormat.Alignment = HorizontalAlignment.Center;
            CharacterFormat cf = Template.FormatNormal.cFormat;

            par.Content.Start.Insert("Page ", cf.Clone());

            // Page numbering is a Field.
            // Create two fields: FieldType.Page and FieldType.NumPages.
            Field fPage = new Field(docx, FieldType.Page);

            fPage.CharacterFormat = cf.Clone();
            par.Content.End.Insert(fPage.Content);
            par.Content.End.Insert(" of ", cf.Clone());
            par.Content.End.Insert(new Field(docx, FieldType.NumPages).Content);
            par.Content.End.Insert(" - Generated by Jimmy Vo", cf.Clone());

            // Add the paragraph with Fields into the footer.
            footer.Blocks.Add(par);

            // Add the footer into the section.
            section.HeadersFooters.Add(footer);

            docx.Save(Template.PathOutput);

            System.Diagnostics.Process.Start(Path.Combine(Directory.GetCurrentDirectory(), Template.PathOutput));
        }
        public override void CreatePackage(string fileName)
        {
            var document = DocumentModel.Load(DocumentTemplate.ExtractDoc("EnrollmentDisagreementClaim"));

            // Подготовка стилей
            var underlinedText = new CharacterFormat
            {
                UnderlineColor = Color.Black,
                UnderlineStyle = UnderlineType.Single
            };

            // Вставляем текст на закладки

            string direction = string.Format("{0} {1} ({2}), {3} форма обучения",
                                             _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.Direction.Code,
                                             _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.Direction.Name,
                                             _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.EducationProgramType.Name,
                                             _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.EducationForm.Name);

            string direction1 = string.Format("{4}, {0} {1} ({2}), {3} форма обучения",
                                              _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.Direction.Code,
                                              _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.Direction.Name,
                                              _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.EducationProgramType.Name,
                                              _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.EducationForm.Name,
                                              _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.Faculty.Name);

            document.InsertToBookmark("Date", DateTime.Now.ToString("«dd» MMMM yyyy г."), underlinedText);
            document.InsertToBookmark("Date1", DateTime.Now.ToString("«dd» MMMM yyyy г."),
                                      new CharacterFormat
            {
                UnderlineColor = Color.Black,
                UnderlineStyle = UnderlineType.Single,
                Size           = 16,
                FontName       = "Times New Roman",
                FontColor      = Color.Black
            });
            document.InsertToBookmark("BirthDate", ((DateTime)_claim.IdentityDocuments.First().BirthDate).ToString("dd.MM.yyyy г."));
            document.InsertToBookmark("Citizenship", _claim.IdentityDocuments.First().Citizenship.Name);
            document.InsertToBookmark("CurrentUser", string.Format("{0} {1}.{2}.",
                                                                   Session.CurrentUser.LastName, Session.CurrentUser.FirstName[0], Session.CurrentUser.Patronymic[0]));
            document.InsertToBookmark("Direction", direction);
            document.InsertToBookmark("DocIssueInfo", string.Format("{0}, {1}",
                                                                    _claim.IdentityDocuments.First().Organization,
                                                                    ((DateTime)_claim.IdentityDocuments.First().Date).ToString("dd.MM.yyyy г.")));
            document.InsertToBookmark("DocNumber",
                                      _claim.IdentityDocuments.First().Number);
            document.InsertToBookmark("DocSeries",
                                      _claim.IdentityDocuments.First().Series);
            document.InsertToBookmark("DocumentName",
                                      _claim.IdentityDocuments.First().IdentityDocumentType.Name);
            document.InsertToBookmark("EntrantName",
                                      _claim.Person.FullName);
            document.InsertToBookmark("EnrollmentOrder",
                                      string.Format("№{0} от {1}",
                                                    _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.EnrollmentOrder.Number,
                                                    ((DateTime)_claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.EnrollmentOrder.Date).ToString("dd.MM.yyyy г.")),
                                      new CharacterFormat
            {
                UnderlineColor = Color.Black,
                UnderlineStyle = UnderlineType.Single,
                Size           = 16,
                FontName       = "Times New Roman",
                FontColor      = Color.Black
            });
            document.InsertToBookmark("EntrantName1",
                                      _claim.Person.FullName);
            document.InsertToBookmark("EntrantName2",
                                      _claim.Person.FullName);
            document.InsertToBookmark("FinanceSource",
                                      _claim.EnrollmentClaims.Where(ec => ec.EnrollmentExceptionOrder != null).First().EnrollmentProtocol.CompetitiveGroup.FinanceSource.NameInDocument);
            document.InsertToBookmark("FacultyName", direction1);

            // Сохраняем в файл
            document.Save(fileName);
        }
示例#20
0
        public override void CreatePackage(string fileName)
        {
            // Загружаем документ
            var document = DocumentModel.Load(DocumentTemplate.ExtractDoc("EnrollmentOrderStatement"));

            // Подготовка стилей
            var underlinedText = new CharacterFormat
            {
                UnderlineColor = Color.Black,
                UnderlineStyle = UnderlineType.Single
            };

            var ec = _claim.EnrollmentClaims.Where(e => e.EnrollmentExceptionOrder == null).FirstOrDefault();

            if (ec == null)
            {
                throw new Exception("Нет приказа о зачислении из которого этот чувак не был бы исключен.");
            }

            // Вставляем текст на закладки
            document.InsertToBookmark("OrderDate",
                                      ((DateTime)ec.EnrollmentProtocol.EnrollmentOrder.Date).ToString("«dd» MMMM yyyy г."));
            document.InsertToBookmark("OrderNumber",
                                      ec.EnrollmentProtocol.EnrollmentOrder.Number,
                                      underlinedText);
            document.InsertToBookmark("TrainingBeginDate",
                                      ((DateTime)ec.EnrollmentProtocol.TrainingBeginDate).ToString("d MMMM yyyy"));
            document.InsertToBookmark("TrainingEndDate",
                                      ((DateTime)ec.EnrollmentProtocol.TrainingEndDate).ToString("d MMMM yyyy г."));
            document.InsertToBookmark("EducationFormName",
                                      ChangeToAccusative(_claim.EnrollmentClaims.First().EnrollmentProtocol.CompetitiveGroup.EducationForm.Name));
            document.InsertToBookmark("FacultyName",
                                      ec.EnrollmentProtocol.Faculty.Name);
            document.InsertToBookmark("DirectionString",
                                      string.Format("Направление подготовки ({0}): {1} {2}",
                                                    ec.EnrollmentProtocol.CompetitiveGroup.EducationProgramType.Name,
                                                    ec.EnrollmentProtocol.CompetitiveGroup.Direction.Code,
                                                    ec.EnrollmentProtocol.CompetitiveGroup.Direction.Name));
            document.InsertToBookmark("TableStringNumber",
                                      ec.StringNumber.ToString());
            document.InsertToBookmark("StudentName",
                                      _claim.Person.FullName);
            document.InsertToBookmark("EnrollmentReason",
                                      ec.EnrollmentProtocol.CompetitiveGroup.FinanceSource.EnrollmentReason);
            document.InsertToBookmark("ClaimNumber",
                                      _claim.Number);
            string totalScore;

            if (_claim.TotalScore > 0)
            {
                totalScore = _claim.TotalScore.ToString();
            }
            else
            {
                totalScore = _claim.MiddleMark.ToString();
            }
            document.InsertToBookmark("TotalScore",
                                      totalScore);
            document.InsertToBookmark("ProtocolInfo",
                                      string.Format("№ {0} от {1}",
                                                    ec.EnrollmentProtocol.Number,
                                                    ((DateTime)ec.EnrollmentProtocol.Date).ToString("dd.MM.yyyy г.")));
            document.InsertToBookmark("StatementDate",
                                      ((DateTime)ec.EnrollmentProtocol.EnrollmentOrder.Date).ToString("dd.MM.yyyy г."));

            document.InsertToBookmark("TrainingPeriod",
                                      _claim.EnrollmentClaims.First().EnrollmentProtocol.TrainingTime.AsPeriod());

            document.Save(fileName, SaveOptions.DocxDefault);
        }
示例#21
0
    private static void smethod_5(Class857 A_0, Class101 A_1, ListLevel A_2, string A_3)
    {
        int      num    = 14;
        Class396 class2 = A_0.method_11();

        A_2.PatternType = ListPatternType.None;
        string str  = "";
        string str2 = "";
        int    num2 = 0;
        int    num3 = 1;
        int    key  = -1;

        while (class2.method_19())
        {
            string str3 = class2.method_1();
            if (str3 != null)
            {
                int num6;
                if (Class1160.dictionary_107 == null)
                {
                    Dictionary <string, int> dictionary1 = new Dictionary <string, int>(7);
                    dictionary1.Add(BookmarkStart.b("堳匵丷弹倻", num), 0);
                    dictionary1.Add(BookmarkStart.b("娳䌵唷᜹娻儽㈿⽁╃㉅", num), 1);
                    dictionary1.Add(BookmarkStart.b("倳張䬷䨹倻弽㤿潁⡃⍅㹇⽉⁋㵍", num), 2);
                    dictionary1.Add(BookmarkStart.b("䜳䈵䄷嘹夻ጽ⸿⍁⥃⍅", num), 3);
                    dictionary1.Add(BookmarkStart.b("䜳䈵夷䠹䠻ጽ㘿⍁⡃㍅ⵇ", num), 4);
                    dictionary1.Add(BookmarkStart.b("娳䌵唷᜹伻䬽☿⑁ⵃ㹅", num), 5);
                    dictionary1.Add(BookmarkStart.b("娳䌵唷᜹䰻䰽┿⑁ⵃ㹅", num), 6);
                    Class1160.dictionary_107 = dictionary1;
                }
                if (Class1160.dictionary_107.TryGetValue(str3, out num6))
                {
                    switch (num6)
                    {
                    case 0:
                        key = class2.method_4();
                        break;

                    case 1:
                        A_2.PatternType = Class922.smethod_57(class2.method_3());
                        break;

                    case 2:
                        num2 = class2.method_4();
                        break;

                    case 3:
                        A_1.method_23()[A_2.LevelNumber] = Class576.smethod_87(class2.method_3());
                        break;

                    case 4:
                        num3 = class2.method_4();
                        break;

                    case 5:
                        str = class2.method_3();
                        break;

                    case 6:
                        str2 = class2.method_3();
                        break;
                    }
                }
            }
        }
        A_2.StartAt = num3;
        int num5 = A_2.LevelNumber + 1;

        if (num2 != 0)
        {
            smethod_6(num2, A_2);
        }
        else
        {
            A_2.NumberPrefix = str2;
            A_2.NumberSufix  = str;
            A_2.LevelText    = str2 + BookmarkStart.b("ᄳ", num) + num5.ToString() + str;
        }
        bool flag = false;

        while (class2.method_9(A_3))
        {
            string str4 = class2.method_1();
            if (str4 != null)
            {
                if (!(str4 == BookmarkStart.b("堳張䬷丹ᄻ刽┿㑁⅃⩅敇㩉㹋⅍⁏㝑♓≕ㅗ㽙⽛", num)))
                {
                    if (!(str4 == BookmarkStart.b("䀳匵䀷丹ᄻ丽㈿ⵁ㑃⍅㩇㹉╋⭍⍏", num)))
                    {
                        goto Label_022E;
                    }
                    CharacterFormat format = Class1141.smethod_0(A_0, A_1);
                    if (format.Count > 0)
                    {
                        format.method_37(A_2.CharacterFormat);
                    }
                }
                else
                {
                    Class693.smethod_0(A_0, A_2);
                    flag = true;
                }
                continue;
            }
Label_022E:
            class2.vmethod_1();
        }
        if (key != -1)
        {
            A_1.hashtable_0.Add(key, flag);
        }
    }
示例#22
0
 private static void smethod_1(Interface52 A_0, CharacterFormat A_1)
 {
     A_0.imethod_1();
 }
示例#23
0
    internal static void smethod_0(Class857 A_0, bool A_1)
    {
        int      num    = 4;
        Class396 class2 = A_0.method_11();
        string   str    = class2.method_1();
        Class93  class3 = smethod_1(class2.method_12(BookmarkStart.b("䰩䴫䌭夯帱䴳", 4), null));

        smethod_2(A_0, class3);
        while (class2.method_9(str))
        {
            string key = class2.method_1();
            if (key != null)
            {
                int num2;
                if (Class1160.dictionary_185 == null)
                {
                    Dictionary <string, int> dictionary1 = new Dictionary <string, int>(11);
                    dictionary1.Add(BookmarkStart.b("帩䤫嘭䐯ἱ䐳䐵圷䨹夻䰽㐿⭁⅃㕅", num), 0);
                    dictionary1.Add(BookmarkStart.b("娩䴫尭儯唱䘳圵䠷刹ᄻ丽㈿ⵁ㑃⍅㩇㹉╋⭍⍏", num), 1);
                    dictionary1.Add(BookmarkStart.b("天䤫䴭䐯嬱嬳堵ᔷ䨹主儽〿❁㙃㉅ⅇ⽉㽋", num), 2);
                    dictionary1.Add(BookmarkStart.b("帩䴫䰭尯圱ᤳ䘵䨷唹䰻嬽㈿㙁ⵃ⍅㭇", num), 3);
                    dictionary1.Add(BookmarkStart.b("帩䴫䰭尯圱ᤳ唵圷嘹䤻匽⸿潁㑃㑅❇㩉⥋㱍⑏㭑ㅓ╕", num), 4);
                    dictionary1.Add(BookmarkStart.b("帩䴫䰭尯圱ᤳ䐵圷䴹ᄻ丽㈿ⵁ㑃⍅㩇㹉╋⭍⍏", num), 5);
                    dictionary1.Add(BookmarkStart.b("帩䴫䰭尯圱ᤳ唵崷嘹倻ጽ〿ぁ⭃㙅ⵇ㡉㡋❍㕏⅑", num), 6);
                    dictionary1.Add(BookmarkStart.b("䴩師伭䀯娱崳唵ᔷ䨹主儽〿❁㙃㉅ⅇ⽉㽋", num), 7);
                    dictionary1.Add(BookmarkStart.b("堩夫䰭䤯ἱ䐳䐵圷䨹夻䰽㐿⭁⅃㕅", num), 8);
                    dictionary1.Add(BookmarkStart.b("丩師伭䜯嬱娳儵ᔷ䨹崻夽┿潁㑃㑅❇㩉⥋㱍⑏㭑ㅓ╕", num), 9);
                    dictionary1.Add(BookmarkStart.b("䤩䐫伭䈯䘱ᤳ䘵䨷唹䰻嬽㈿㙁ⵃ⍅㭇", num), 10);
                    Class1160.dictionary_185 = dictionary1;
                }
                if (Class1160.dictionary_185.TryGetValue(key, out num2))
                {
                    switch (num2)
                    {
                    case 0:
                        goto Label_0175;

                    case 1:
                    {
                        if (class3 is Class97)
                        {
                            Class413.smethod_0(A_0, (Class97)class3);
                        }
                        continue;
                    }

                    case 2:
                    {
                        if (class3 is Class95)
                        {
                            Class242.smethod_0(A_0, (Class95)class3);
                        }
                        continue;
                    }

                    case 3:
                    {
                        if (class3 is Class106)
                        {
                            Class853.smethod_0(A_0, (Class106)class3);
                        }
                        continue;
                    }

                    case 4:
                    {
                        if (class3 is Class94)
                        {
                            Class853.smethod_5(A_0, (Class94)class3);
                        }
                        continue;
                    }

                    case 5:
                    {
                        if (class3 is Class103)
                        {
                            Class853.smethod_1(A_0, (Class103)class3);
                        }
                        continue;
                    }

                    case 6:
                    {
                        if (class3 is Class100)
                        {
                            Class853.smethod_2(A_0, (Class100)class3);
                        }
                        continue;
                    }

                    case 7:
                    {
                        if (class3 is Class98)
                        {
                            Class794.smethod_0(A_0, (Class98)class3);
                        }
                        continue;
                    }

                    case 8:
                    {
                        if (class3 is Class105)
                        {
                            Class1095.smethod_0(A_0, (Class105)class3);
                        }
                        continue;
                    }

                    case 9:
                    {
                        if (class3 is Class104)
                        {
                            Class529.smethod_0(A_0, (Class104)class3);
                        }
                        continue;
                    }

                    case 10:
                    {
                        if (class3 is Class99)
                        {
                            Class648.smethod_0(A_0, (Class99)class3);
                        }
                        continue;
                    }
                    }
                }
            }
            goto Label_02BD;
Label_0175:
            if (class3 is Class96)
            {
                Class96         class4 = (Class96)class3;
                CharacterFormat format = Class1141.smethod_0(A_0, (Class96)class3);
                if (format.Count > 0)
                {
                    class4.method_14(format);
                }
                if (class3.method_8() != null)
                {
                    format.CharStyleName = class3.method_8();
                }
            }
            continue;
Label_02BD:
            class2.vmethod_1();
        }
        A_0.method_13().method_1(class3, A_0.method_20(), A_1);
    }
示例#24
0
    private static bool smethod_3(CharacterFormat A_0, IRunAttrSource A_1, bool A_2, bool A_3, bool A_4, Interface52 A_5, bool A_6)
    {
        int num = 13;

        if (A_0 == null)
        {
            return(false);
        }
        bool     flag    = A_5.imethod_2();
        int      num2    = 0;
        string   styleId = null;
        string   str2    = null;
        string   str3    = null;
        string   str4    = null;
        string   str5    = null;
        string   str6    = null;
        string   str7    = null;
        string   str8    = null;
        string   str9    = null;
        string   str10   = null;
        object   obj2    = null;
        object   obj3    = null;
        object   obj4    = null;
        object   obj5    = null;
        object   obj6    = null;
        object   obj7    = null;
        object   obj8    = null;
        object   obj9    = null;
        object   obj10   = null;
        object   obj11   = null;
        object   obj12   = null;
        object   obj13   = null;
        object   obj14   = null;
        object   obj15   = null;
        object   obj16   = null;
        object   obj17   = null;
        object   obj18   = null;
        object   obj19   = null;
        object   obj20   = null;
        object   obj21   = null;
        object   obj22   = null;
        object   obj23   = null;
        object   obj24   = null;
        object   obj25   = null;
        object   obj26   = null;
        object   obj27   = null;
        object   obj28   = null;
        string   str11   = null;
        string   str12   = null;
        string   str13   = null;
        Border   border  = null;
        Class16  class2  = null;
        string   str14   = null;
        string   str15   = null;
        string   str16   = null;
        object   obj29   = null;
        object   obj30   = null;
        string   str17   = null;
        string   str18   = null;
        string   str19   = null;
        string   str20   = null;
        string   str21   = null;
        string   str22   = null;
        Class340 class3  = null;
        object   obj31   = null;
        object   obj32   = null;
        object   obj33   = null;
        object   obj34   = null;
        bool     flag2   = false;

        for (int i = 0; i < A_0.Count; i++)
        {
            int    num4  = A_0.method_18(i);
            object obj35 = A_0.method_19(i);
            num2++;
            int num5 = num4;
            if (num5 <= 0x109)
            {
                if (num5 <= 150)
                {
                    if (num5 <= 80)
                    {
                        if (num5 <= 0x2d)
                        {
                            switch (num5)
                            {
                            case 10:
                            {
                                obj31 = A_0.method_62((short)num4);
                                continue;
                            }

                            case 12:
                            {
                                if (!A_6 && !(A_1 is Paragraph))
                                {
                                    num2--;
                                }
                                continue;
                            }

                            case 14:
                            {
                                if (!A_6 && !(A_1 is Paragraph))
                                {
                                    num2--;
                                }
                                continue;
                            }

                            case 20:
                            {
                                obj28 = Class860.smethod_20((Color)obj35, flag);
                                continue;
                            }

                            case 0x2d:
                            {
                                num2--;
                                continue;
                            }
                            }
                            goto Label_08AF;
                        }
                        switch (num5)
                        {
                        case 60:
                        {
                            obj2 = A_0.method_62((short)num4);
                            continue;
                        }

                        case 70:
                        {
                            obj4 = A_0.method_62((short)num4);
                            continue;
                        }
                        }
                        if (num5 != 80)
                        {
                            goto Label_08AF;
                        }
                        obj8 = A_0.method_62((short)num4);
                    }
                    else if (num5 <= 110)
                    {
                        switch (num5)
                        {
                        case 90:
                        {
                            obj10 = A_0.method_62((short)num4);
                            continue;
                        }

                        case 100:
                        {
                            obj11 = A_0.method_62((short)num4);
                            continue;
                        }
                        }
                        if (num5 != 110)
                        {
                            goto Label_08AF;
                        }
                        obj7 = A_0.method_62((short)num4);
                    }
                    else
                    {
                        if (num5 <= 0x84)
                        {
                            switch (num5)
                            {
                            case 130:
                            {
                                obj16 = A_0.method_62((short)num4);
                                continue;
                            }

                            case 0x84:
                            {
                                obj17 = A_0.method_62((short)num4);
                                continue;
                            }

                            case 120:
                            {
                                obj6 = A_0.method_62((short)num4);
                                continue;
                            }
                            }
                            goto Label_08AF;
                        }
                        if (num5 == 140)
                        {
                            str11 = Class860.smethod_18((UnderlineStyle)obj35, flag);
                        }
                        else
                        {
                            if (num5 != 150)
                            {
                                goto Label_08AF;
                            }
                            if (((float)obj35) != 0f)
                            {
                                obj22 = (int)(((float)obj35) * 20f);
                            }
                        }
                    }
                }
                else if (num5 <= 210)
                {
                    if (num5 <= 180)
                    {
                        switch (num5)
                        {
                        case 160:
                        {
                            obj18 = obj35;
                            continue;
                        }

                        case 170:
                        {
                            obj12 = A_0.method_62((short)num4);
                            continue;
                        }
                        }
                        if (num5 != 180)
                        {
                            goto Label_08AF;
                        }
                        obj13 = A_0.method_62((short)num4);
                    }
                    else
                    {
                        switch (num5)
                        {
                        case 190:
                        {
                            obj26 = obj35;
                            continue;
                        }

                        case 200:
                        {
                            obj25 = ((float)obj35) * 2f;
                            continue;
                        }
                        }
                        if (num5 != 210)
                        {
                            goto Label_08AF;
                        }
                        str16 = Class860.smethod_22((SubSuperScript)obj35);
                    }
                }
                else if (num5 <= 0xeb)
                {
                    switch (num5)
                    {
                    case 220:
                    {
                        obj24 = ((float)obj35) * 2f;
                        continue;
                    }

                    case 230:
                    {
                        str2 = (string)obj35;
                        continue;
                    }
                    }
                    if (num5 != 0xeb)
                    {
                        goto Label_08AF;
                    }
                    str4 = (string)obj35;
                }
                else if (num5 <= 250)
                {
                    if (num5 != 240)
                    {
                        if (num5 != 250)
                        {
                            goto Label_08AF;
                        }
                        obj3 = A_0.method_62((short)num4);
                    }
                    else
                    {
                        str3 = (string)obj35;
                    }
                }
                else if (num5 != 260)
                {
                    if (num5 != 0x109)
                    {
                        goto Label_08AF;
                    }
                    obj29 = A_0.method_62((short)num4);
                }
                else
                {
                    obj5 = A_0.method_62((short)num4);
                }
                continue;
            }
            if (num5 <= 440)
            {
                if (num5 <= 340)
                {
                    if (num5 <= 300)
                    {
                        switch (num5)
                        {
                        case 0x10c:
                        {
                            obj30 = A_0.method_62((short)num4);
                            continue;
                        }

                        case 270:
                        {
                            str5 = (string)obj35;
                            continue;
                        }

                        case 290:
                        {
                            obj23 = obj35;
                            continue;
                        }

                        case 300:
                        {
                            obj9 = A_0.method_62((short)num4);
                            continue;
                        }
                        }
                        goto Label_08AF;
                    }
                    switch (num5)
                    {
                    case 310:
                    {
                        str13 = Class860.smethod_16((TextEffect)obj35, flag);
                        continue;
                    }

                    case 330:
                    {
                        obj15 = A_0.method_62((short)num4);
                        continue;
                    }
                    }
                    if (num5 != 340)
                    {
                        goto Label_08AF;
                    }
                    str22 = Class860.smethod_1((short)obj35, flag);
                    if (!Class567.smethod_16(str22))
                    {
                        num2--;
                    }
                }
                else if (num5 <= 370)
                {
                    switch (num5)
                    {
                    case 350:
                    {
                        obj27 = obj35;
                        continue;
                    }

                    case 360:
                    {
                        border = (Border)obj35;
                        continue;
                    }
                    }
                    if (num5 != 370)
                    {
                        goto Label_08AF;
                    }
                    class2 = (Class16)obj35;
                }
                else if (num5 <= 390)
                {
                    if (num5 != 380)
                    {
                        if (num5 != 390)
                        {
                            goto Label_08AF;
                        }
                        str21 = Class860.smethod_1((short)obj35, flag);
                        if (!Class567.smethod_16(str21))
                        {
                            num2--;
                        }
                    }
                    else
                    {
                        str20 = Class860.smethod_1((short)obj35, flag);
                        if (!Class567.smethod_16(str20))
                        {
                            num2--;
                        }
                    }
                }
                else if (num5 != 400)
                {
                    if (num5 != 440)
                    {
                        goto Label_08AF;
                    }
                    obj14 = A_0.method_62((short)num4);
                }
                else
                {
                    str6 = Class860.smethod_10((CharacterCategory)Enum.ToObject(typeof(CharacterCategory), obj35), flag);
                }
                continue;
            }
            if (num5 <= 530)
            {
                if (num5 <= 470)
                {
                    switch (num5)
                    {
                    case 450:
                    {
                        str12 = Class114.smethod_12((Color)obj35);
                        continue;
                    }

                    case 460:
                    {
                        if (flag)
                        {
                            num2--;
                        }
                        else
                        {
                            str19 = Class860.smethod_24((HyphenRule)obj35);
                        }
                        continue;
                    }
                    }
                    if (num5 != 470)
                    {
                        goto Label_08AF;
                    }
                    num2--;
                    continue;
                }
                if (num5 <= 510)
                {
                    if (num5 == 500)
                    {
                        if (flag)
                        {
                            obj19 = obj35;
                        }
                        else
                        {
                            num2--;
                        }
                    }
                    else
                    {
                        if (num5 != 510)
                        {
                            goto Label_08AF;
                        }
                        if (flag)
                        {
                            obj20 = obj35;
                        }
                        else
                        {
                            num2--;
                        }
                    }
                    continue;
                }
                switch (num5)
                {
                case 520:
                {
                    if (!flag)
                    {
                        break;
                    }
                    obj21 = obj35;
                    continue;
                }

                case 0x209:
                {
                    if (!flag)
                    {
                        num2--;
                    }
                    continue;
                }

                case 0x20a:
                {
                    if (!flag)
                    {
                        num2--;
                    }
                    continue;
                }

                case 0x20b:
                {
                    if (!flag)
                    {
                        num2--;
                    }
                    continue;
                }

                case 530:
                {
                    if (flag)
                    {
                        str7 = (string)obj35;
                    }
                    else
                    {
                        num2--;
                    }
                    continue;
                }

                default:
                    goto Label_08AF;
                }
                num2--;
                continue;
            }
            if (num5 <= 560)
            {
                switch (num5)
                {
                case 540:
                {
                    if (flag)
                    {
                        str8 = (string)obj35;
                    }
                    else
                    {
                        num2--;
                    }
                    continue;
                }

                case 550:
                {
                    if (flag)
                    {
                        str9 = (string)obj35;
                    }
                    else
                    {
                        num2--;
                    }
                    continue;
                }
                }
                if (num5 != 560)
                {
                    goto Label_08AF;
                }
                if (flag)
                {
                    str10 = (string)obj35;
                }
                else
                {
                    num2--;
                }
                continue;
            }
            if (num5 <= 770)
            {
                if (num5 != 760)
                {
                    if (num5 != 770)
                    {
                        goto Label_08AF;
                    }
                    str17 = Class860.smethod_4((Emphasis)obj35, flag);
                }
                else
                {
                    flag2 = true;
                }
                continue;
            }
            switch (num5)
            {
            case 780:
            {
                class3 = (Class340)obj35;
                continue;
            }

            case 0x271a:
            {
                continue;
            }
            }
Label_08AF:
            num2--;
        }
        if ((A_0 != null) && !string.IsNullOrEmpty(A_0.CharStyleName))
        {
            Style style = A_0.Document.Styles.DocStyleCollection.FindByName(A_0.CharStyleName);
            if (style != null)
            {
                if (flag)
                {
                    styleId = style.StyleId;
                }
                else
                {
                    styleId = A_5.imethod_4(style.StyleDocId);
                }
                num2++;
            }
            else
            {
                styleId = null;
            }
        }
        else
        {
            styleId = null;
        }
        if ((num2 == 0) && !A_4)
        {
            return(false);
        }
        Class398 class4 = A_5.imethod_1();

        if (A_3)
        {
            class4.method_4(BookmarkStart.b("䐲༴䜶椸䤺", num));
        }
        class4.method_4(BookmarkStart.b("䐲༴䔶椸䤺", num));
        if (!A_6 && (A_1 is Paragraph))
        {
            if (A_0.HasInsertRevision)
            {
                string str23 = flag ? (A_5 as Class421).class401_0.method_3().method_476() : A_5.imethod_6().ToString();
                class4.vmethod_12(A_0.InsertRevision, str23, flag);
            }
            if (A_0.HasDeleteRevision)
            {
                string str24 = flag ? (A_5 as Class421).class401_0.method_3().method_476() : A_5.imethod_6().ToString();
                class4.vmethod_12(A_0.DeleteRevision, str24, flag);
            }
        }
        class4.method_24(BookmarkStart.b("䐲༴䔶樸伺䐼匾⑀", num), styleId);
        if (flag)
        {
            class4.method_31(BookmarkStart.b("䐲༴堶琸娺䤼圾", num), flag2);
            class4.method_33(BookmarkStart.b("䐲༴䔶缸吺匼䬾㉀", num), new object[] {
                BookmarkStart.b("䐲༴嘶䨸堺吼嘾", num), str2, BookmarkStart.b("䐲༴制堸䠺䤼績㉀⩂⑄", num), str4, BookmarkStart.b("䐲༴弶砸唺丼嘾", num), str3, BookmarkStart.b("䐲༴嘶䨸堺吼嘾ᕀ⭂⁄⩆ⱈ", num), str7, BookmarkStart.b("䐲༴制堸䠺䤼績㉀⩂⑄ፆⅈ⹊⁌⩎", num), str9, BookmarkStart.b("䐲༴弶砸唺丼嘾ᕀ⭂⁄⩆ⱈ", num), str8, BookmarkStart.b("䐲༴吶䨸", num), str5, BookmarkStart.b("䐲༴吶䨸伺唼娾ⱀ♂", num), str10,
                BookmarkStart.b("䐲༴弶倸唺䤼", num), str6
            });
        }
        else
        {
            class4.method_33(BookmarkStart.b("䐲༴䔶缸吺匼䬾㉀", num), new object[] { BookmarkStart.b("䐲༴嘶䨸堺吼嘾", num), str2, BookmarkStart.b("䐲༴儶堸䤺堼帾㉀㝂", num), str4, BookmarkStart.b("䐲༴弶ᐸ娺匼䰾⡀", num), str3, BookmarkStart.b("䐲༴吶䨸", num), str5, BookmarkStart.b("䐲༴弶倸唺䤼", num), str6 });
        }
        class4.method_22(BookmarkStart.b("䐲༴唶", num), obj2);
        class4.method_22(flag ? BookmarkStart.b("䐲༴唶稸䠺", num) : BookmarkStart.b("䐲༴唶ᐸ堺丼", num), obj3);
        class4.method_22(BookmarkStart.b("䐲༴帶", num), obj4);
        class4.method_22(flag ? BookmarkStart.b("䐲༴帶稸䠺", num) : BookmarkStart.b("䐲༴帶ᐸ堺丼", num), obj5);
        class4.method_22(BookmarkStart.b("䐲༴吶堸䬺丼", num), obj6);
        class4.method_22(BookmarkStart.b("䐲༴䐶吸娺儼匾ɀ≂㕄㑆", num), obj7);
        class4.method_22(BookmarkStart.b("䐲༴䐶䴸䤺吼吾⑀", num), obj8);
        class4.method_22(BookmarkStart.b("䐲༴匶䨸伺似嘾⩀♂", num), obj9);
        class4.method_22(BookmarkStart.b("䐲༴堶䰸伺儼嘾⽀♂", num), obj10);
        class4.method_22(BookmarkStart.b("䐲༴䐶儸娺夼倾㙀", num), obj11);
        class4.method_22(BookmarkStart.b("䐲༴制吸夺刼䰾㉀", num), obj12);
        class4.method_22(BookmarkStart.b("䐲༴帶吸䬺似嘾⽀㝂", num), obj13);
        class4.method_22(BookmarkStart.b("䐲༴夶嘸欺似倾⹀╂", num), obj14);
        class4.method_22(BookmarkStart.b("䐲༴䐶圸娺䴼款⹀т㝄⹆ⵈ", num), obj15);
        class4.method_22(BookmarkStart.b("䐲༴䄶堸唺吼䰾⥀", num), obj16);
        class4.method_22(BookmarkStart.b("䐲༴䀶尸夺甼嘾╀❂⁄⥆", num), obj17);
        if (flag)
        {
            class4.method_33(BookmarkStart.b("䐲༴吶嘸场刼䴾", num), new object[] { BookmarkStart.b("䐲༴䄶堸场", num), obj18, BookmarkStart.b("䐲༴䌶儸帺值娾ɀⱂ⥄⡆㭈", num), obj19, BookmarkStart.b("䐲༴䌶儸帺值娾ቀ⭂⑄⍆ⱈ", num), obj20, BookmarkStart.b("䐲༴䌶儸帺值娾ᕀ⩂⭄㍆", num), obj21 });
        }
        else
        {
            class4.method_22(BookmarkStart.b("䐲༴吶嘸场刼䴾", num), obj18);
        }
        class4.method_22(BookmarkStart.b("䐲༴䐶䤸娺帼嘾⽀⑂", num), obj22);
        class4.method_22(BookmarkStart.b("䐲༴䀶", num), obj23);
        class4.method_22(BookmarkStart.b("䐲༴尶尸䤺匼", num), obj24);
        class4.method_22(BookmarkStart.b("䐲༴䜶嘸䠺吼䬾⡀ⱂ⭄", num), obj25);
        class4.method_22(BookmarkStart.b("䐲༴䐶䌸", num), class4.method_23(obj26, 2f));
        class4.method_22(flag ? BookmarkStart.b("䐲༴䐶䌸砺丼", num) : BookmarkStart.b("䐲༴䐶䌸ᘺ帼䰾", num), class4.method_23(obj27, 2f));
        class4.method_22(BookmarkStart.b("䐲༴弶倸尺唼匾⡀⑂ⵄ㍆", num), obj28);
        class4.method_33(BookmarkStart.b("䐲༴䈶", num), new object[] { BookmarkStart.b("䐲༴䄶堸场", num), str11, BookmarkStart.b("䐲༴吶嘸场刼䴾", num), str12 });
        class4.method_24(BookmarkStart.b("䐲༴制弸崺堼尾㕀", num), str13);
        class4.method_47(BookmarkStart.b("䐲༴唶崸䤺", num), border, flag);
        class4.vmethod_4(class2);
        class4.method_33(BookmarkStart.b("䐲༴儶倸伺椼娾㥀㝂", num), new object[] { BookmarkStart.b("䐲༴䄶堸场", num), str14, BookmarkStart.b("䐲༴帶崸", num), str15 });
        class4.method_24(BookmarkStart.b("䐲༴䄶尸䤺䤼績ⵀ⩂≄⥆", num), str16);
        class4.method_22(BookmarkStart.b("䐲༴䔶䴸场", num), obj29);
        class4.method_22(BookmarkStart.b("䐲༴吶䨸", num), obj30);
        class4.method_24(BookmarkStart.b("䐲༴制吸", num), str17);
        if (!flag)
        {
            class4.method_33(BookmarkStart.b("䐲༴弶䀸䬺唼娾⽀", num), new object[] { BookmarkStart.b("䐲༴䄶堸场", num), str18, BookmarkStart.b("䐲༴䔶䰸场堼", num), str19 });
        }
        class4.method_33(BookmarkStart.b("䐲༴嬶堸唺娼", num), new object[] { BookmarkStart.b("䐲༴䄶堸场", num), str20, flag ? BookmarkStart.b("䐲༴制堸䠺䤼績㉀⩂⑄", num) : BookmarkStart.b("䐲༴儶堸䤺堼帾㉀㝂", num), str21, BookmarkStart.b("䐲༴唶倸强吼", num), str22 });
        if (class3 != null)
        {
            smethod_4(class4, class3, flag);
        }
        class4.method_22(BookmarkStart.b("䐲༴䐶䤸帺帼椾⁀ⵂⱄ㑆ⅈ", num), obj31);
        if (!flag)
        {
            class4.method_22(BookmarkStart.b("䐲䴴ശ弸吺匼䬾", num), obj32);
            class4.method_33(BookmarkStart.b("䐲䴴ശ䨸䈺值", num), new object[] { BookmarkStart.b("䐲䴴ശ弸吺匼䬾", num), obj33, BookmarkStart.b("䐲䴴ശ娸区尼䴾", num), obj34 });
        }
        return(true);
    }
示例#25
0
 internal void method_0(IRunAttrSource A_0, CharacterFormat A_1)
 {
     this.method_1(A_0, A_1, false);
 }
示例#26
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ////List<template_wd_mesa_coverpage> coverpages = template_wd_mesa_coverpage.FindAllBySampleID(2726);
            ////List<template_wd_mesa_img> refImg = template_wd_mesa_img.FindAllBySampleID(2726);
            //Create Table
            Document doc = new Document();
            Section  s   = doc.AddSection();

            #region "PAGE SETUP"
            s.PageSetup.PageSize       = PageSize.A4;
            s.PageSetup.Orientation    = PageOrientation.Portrait;
            s.PageSetup.Margins.Top    = 100.0f;
            s.PageSetup.Margins.Bottom = 72.0f;
            //s.PageSetup.Margins.Left = 89.85f;
            //s.PageSetup.Margins.Right = 89.85f;
            #endregion

            #region "FONT FORMAT"
            CharacterFormat format = new CharacterFormat(doc);
            format.FontName       = "Arial";
            format.FontSize       = 15;
            format.Bold           = false;
            format.UnderlineStyle = UnderlineStyle.Single;
            CharacterFormat format2 = new CharacterFormat(doc);
            format2.FontName       = "Arial";
            format2.FontSize       = 11;
            format2.Bold           = false;
            format2.UnderlineStyle = UnderlineStyle.Single;
            #endregion

            //Initialize a Header Instance
            HeaderFooter header = doc.Sections[0].HeadersFooters.Header;
            //Add Header Paragraph and Format
            Paragraph paragraph1 = header.AddParagraph();
            paragraph1.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Right;
            //Append Picture for Header Paragraph and Format
            DocPicture headerimage = paragraph1.AppendPicture(Image.FromFile(@"C:\Users\icnsk\Documents\Visual Studio 2015\Projects\ALS.ALSI.Web\ALS.ALSI.Web\images\images.png"));
            headerimage.VerticalAlignment = ShapeVerticalAlignment.Bottom;



            #region "PAGE TITLE"
            Paragraph paragraph = s.AddParagraph();
            paragraph.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
            paragraph.AppendText("REPORT").ApplyCharacterFormat(format);
            Paragraph paragraph2 = s.AddParagraph();
            paragraph2.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
            paragraph2.AppendText("");
            Paragraph paragraph3 = s.AddParagraph();
            paragraph3.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
            paragraph3.AppendText("");
            #endregion

            #region "Information"
            Table table = s.AddTable(true);
            //Create Header and Data
            String[]   Header = { "", "", };
            String[][] data   =
            {
                new String[] { "CUSTOMER PO NO.:",      ""                                                },
                new String[] { "ALS THAILAND REF NO.:", "ATT/ELP/16/3148-MB"                              },
                new String[] { "DATE:",                 "13 January 2017"                                 },
                new String[] { "COMPANY:",              "Thai Dai-Ichi Seiko Co., Ltd."                   },
                new String[] { "",                      "700/390 Moo.6 T.Donhuaroh, A.Muang Chonburi"     },
                new String[] { "",                      "Chonburi 20000 Thailand"                         },
                new String[] { "",                      ""                                                },
                new String[] { "DATE SAMPLE RECEIVED:", "13 January 2017"                                 },
                new String[] { "DATE ANALYZED:",        "13 January 2017"                                 },
                new String[] { "DATE TEST COMPLETED:",  "13 January 2017"                                 },
                new String[] { "",                      ""                                                },
                new String[] { "SAMPLE DESCRIPTION:",   "One lot of sample was received with references:" },
                new String[] { "",                      "Description: Ramp Shrek (2063-778130-000) M.2"   },
                new String[] { "",                      "Lot No.7D2063778130000AASDI0200006Z1400100"      },
                new String[] { "",                      "Surface Area: 7.73 sq.cm"                        },
            };

            //Add Cells
            table.ResetCells(data.Length, Header.Length);

            //Header Row
            //TableRow FRow = table.Rows[0];
            //FRow.IsHeader = false;
            ////Row Height
            //FRow.Height = 23;
            ////Header Format
            //FRow.RowFormat.BackColor = Color.AliceBlue;
            //for (int i = 0; i < Header.Length; i++)
            //{
            //    //Cell Alignment
            //    Paragraph p = FRow.Cells[i].AddParagraph();
            //    FRow.Cells[i].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
            //    p.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center;
            //    //Data Format
            //    TextRange TR = p.AppendText(Header[i]);
            //    TR.CharacterFormat.FontName = "Calibri";
            //    TR.CharacterFormat.FontSize = 14;
            //    TR.CharacterFormat.TextColor = Color.Teal;
            //    TR.CharacterFormat.Bold = true;
            //}

            //Data Row
            for (int r = 0; r < data.Length; r++)
            {
                TableRow DataRow = table.Rows[r];

                //Row Height
                DataRow.Height = 11;
                DataRow.Cells[0].SetCellWidth(30, CellWidthType.Percentage);
                DataRow.Cells[1].SetCellWidth(70, CellWidthType.Percentage);
                //C Represents Column.
                for (int c = 0; c < data[r].Length; c++)
                {
                    //Cell Alignment
                    DataRow.Cells[c].CellFormat.VerticalAlignment = VerticalAlignment.Middle;
                    //Fill Data in Rows
                    Paragraph p2  = DataRow.Cells[c].AddParagraph();
                    TextRange TR2 = p2.AppendText(data[r][c]);
                    //Format Cells
                    p2.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Left;
                    TR2.CharacterFormat.FontName  = "Arial";
                    TR2.CharacterFormat.FontSize  = 11;
                    TR2.CharacterFormat.TextColor = Color.Black;
                    DataRow.Cells[c].CellFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.None;
                    DataRow.Cells[c].CellFormat.Borders.Top.BorderType    = Spire.Doc.Documents.BorderStyle.None;
                    DataRow.Cells[c].CellFormat.Borders.Left.BorderType   = Spire.Doc.Documents.BorderStyle.None;
                    DataRow.Cells[c].CellFormat.Borders.Right.BorderType  = Spire.Doc.Documents.BorderStyle.None;
                }
            }

            table.TableFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.None;
            table.TableFormat.Borders.Top.BorderType    = Spire.Doc.Documents.BorderStyle.None;
            table.TableFormat.Borders.Left.BorderType   = Spire.Doc.Documents.BorderStyle.None;
            table.TableFormat.Borders.Right.BorderType  = Spire.Doc.Documents.BorderStyle.None;
            #endregion

            #region "Method/Procedure"
            Paragraph pBlank = s.AddParagraph();
            pBlank.AppendText("");
            Paragraph pMethodProcedure = s.AddParagraph();
            pMethodProcedure.AppendText("METHOD/PROCEDURE:").ApplyCharacterFormat(format2);

            #endregion



            //Save and Launch
            doc.SaveToFile("WordTable.docx");
            System.Diagnostics.Process.Start("WordTable.docx");



            //string[] lines;
            //var list = new List<string>();
            //var fileStream = new FileStream(@"C:\Users\icnsk\Downloads\sky_room_ad\JSON_MUIC_Room_List.txt FileMode.Open, FileAccess.Read);
            //using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
            //{
            //    string line;
            //    while ((line = streamReader.ReadLine()) != null)
            //    {
            //        if (line.IndexOf("room_number") != -1)
            //        {
            //            Console.WriteLine(line);
            //            list.Add(line);
            //        }
            //    }
            //}
            //lines = list.ToArray();
            //Document sourceDoc = new Document(@"C:\Users\icnsk\Downloads\ELP-1362A-DB1.doc");
            //Document destinationDoc = new Document(@"C:\Users\icnsk\Downloads\Blank Letter Head - EL.doc");
            //foreach (Section sec in sourceDoc.Sections)
            //{
            //    foreach (DocumentObject obj in sec.Body.ChildObjects)
            //    {
            //        destinationDoc.Sections[0].Body.ChildObjects.Add(obj.Clone());
            //    }
            //}
            //destinationDoc.SaveToFile("target.docx");
            ////System.Diagnostics.Process.Start("target.docx");

            //Document document = new Document();
            //document.LoadFromFile(@"target.docx");

            ////Convert Word to PDF
            //document.SaveToFile("toPDF.PDF FileFormat.PDF);

            ////Launch Document
            //System.Diagnostics.Process.Start("toPDF.PDF");
        }
示例#27
0
    public bool CharacterFormIsValide(out CharacterFormat characterFormat)
    {
        characterFormat = new CharacterFormat();


        //Character name
        if (inpCharacterName.Validate())
        {
            characterFormat.characterName = inpCharacterName.Content;
        }
        else
        {
            inpCharacterName.DisplayError("Invalid field");
            return(false);
        }

        //level
        if (inpLevel.Validate())
        {
            characterFormat.level = int.Parse(inpLevel.Content);
        }
        else
        {
            inpLevel.DisplayError("Invalid field");
            return(false);
        }

        //HP
        if (inpHp.Validate())
        {
            characterFormat.hp = int.Parse(inpHp.Content);
        }
        else
        {
            inpHp.DisplayError("Invalid field");
            return(false);
        }

        //HP_MAX
        if (inpHpMax.Validate())
        {
            characterFormat.hp_max = int.Parse(inpHpMax.Content);
        }
        else
        {
            inpHpMax.DisplayError("Invalid field");
            return(false);
        }

        //HP_MAX
        if (inpGold.Validate())
        {
            characterFormat.hp_max = int.Parse(inpGold.Content);
        }
        else
        {
            inpGold.DisplayError("Invalid field");
            return(false);
        }

        //Class && race name
        characterFormat.className = dropClasses.options[dropClasses.value].text;
        characterFormat.raceName  = dropRaces.options[dropRaces.value].text;


        //STATS_STR
        if (inpStat_Str.Validate())
        {
            characterFormat.stat_str = int.Parse(inpStat_Str.Content);
        }
        else
        {
            inpStat_Str.DisplayError("Invalid field");
            return(false);
        }

        //STATS_DEX
        if (inpStat_Dex.Validate())
        {
            characterFormat.stat_dex = int.Parse(inpStat_Dex.Content);
        }
        else
        {
            inpStat_Dex.DisplayError("Invalid field");
            return(false);
        }

        //STATS_INT
        if (inpStat_Int.Validate())
        {
            characterFormat.stat_int = int.Parse(inpStat_Int.Content);
        }
        else
        {
            inpStat_Int.DisplayError("Invalid field");
            return(false);
        }

        //STATS_CON
        if (inpStat_Con.Validate())
        {
            characterFormat.stat_con = int.Parse(inpStat_Con.Content);
        }
        else
        {
            inpStat_Con.DisplayError("Invalid field");
            return(false);
        }

        //STATS_WIS
        if (inpStat_Wis.Validate())
        {
            characterFormat.stat_wis = int.Parse(inpStat_Wis.Content);
        }
        else
        {
            inpStat_Wis.DisplayError("Invalid field");
            return(false);
        }

        //STATS_CHA
        if (inpStat_Cha.Validate())
        {
            characterFormat.stat_cha = int.Parse(inpStat_Cha.Content);
        }
        else
        {
            inpStat_Cha.DisplayError("Invalid field");
            return(false);
        }

        return(true);
    }
示例#28
0
        /// <summary>
        /// Creates a simple RTF document.
        /// </summary>
        public static void CreateRtf()
        {
            // Working directory
            string workingDir  = Path.GetFullPath(Directory.GetCurrentDirectory() + @"..\..\..\..\..\..\Testing Files");
            string rtfFilePath = Path.Combine(workingDir, "Result.rtf");

            // Let's create a simple RTF document.
            DocumentCore rtf = new DocumentCore();
            //DocumentCore.Serial = "put your serial here";

            // Add new section.
            Section section = new Section(rtf);

            rtf.Sections.Add(section);

            // Let's set page size A4.
            section.PageSetup.PaperType = PaperType.A4;

            // Add two paragraphs using different ways:

            // Way 1: Add 1st paragraph.
            section.Blocks.Add(new Paragraph(rtf, "This is a first line in 1st paragraph!"));
            Paragraph par1 = section.Blocks[0] as Paragraph;

            par1.ParagraphFormat.Alignment = HorizontalAlignment.Center;

            // Let's add a second line.
            par1.Inlines.Add(new SpecialCharacter(rtf, SpecialCharacterType.LineBreak));
            par1.Inlines.Add(new Run(rtf, "Let's type a second line."));

            // Let's change font name, size and color.
            CharacterFormat cf = new CharacterFormat()
            {
                FontName = "Verdana", Size = 16, FontColor = Color.Orange
            };

            foreach (Inline inline in par1.Inlines)
            {
                if (inline is Run)
                {
                    (inline as Run).CharacterFormat = cf.Clone();
                }
            }

            // Way 2 (easy): Add 2nd paragarph using another way.
            rtf.Content.End.Insert("\nThis is a first line in 2nd paragraph.", new CharacterFormat()
            {
                Size = 25, FontColor = Color.Blue, Bold = true
            });
            SpecialCharacter lBr = new SpecialCharacter(rtf, SpecialCharacterType.LineBreak);

            rtf.Content.End.Insert(lBr.Content);
            rtf.Content.End.Insert("This is a second line.", new CharacterFormat()
            {
                Size = 20, FontColor = Color.DarkGreen, UnderlineStyle = UnderlineType.Single
            });

            // Save RTF to a file
            rtf.Save(rtfFilePath, SaveOptions.RtfDefault);

            // Open the result for demonstation purposes.
            System.Diagnostics.Process.Start(rtfFilePath);
        }
示例#29
0
        /// <summary>
        /// Creates a new PDF document using DOM directly.
        /// </summary>
        /// <remarks>
        /// Details: https://sautinsoft.com/products/document/help/net/developer-guide/create-pdf-document-net-csharp-vb.php
        /// </remarks>
        public static void CreatePdfUsingDOM()
        {
            // Set a path to our document.
            string docPath = @"Result-DocumentCore.pdf";

            // Create a new document.
            DocumentCore dc = new DocumentCore();

            // Add new section.
            Section section = new Section(dc);

            dc.Sections.Add(section);

            // Let's set page size A4.
            section.PageSetup.PaperType = PaperType.A4;

            // Add two paragraphs
            Paragraph par1 = new Paragraph(dc);

            par1.ParagraphFormat.Alignment = HorizontalAlignment.Center;
            section.Blocks.Add(par1);

            // Let's create a characterformat for text in the 1st paragraph.
            CharacterFormat cf = new CharacterFormat()
            {
                FontName = "Verdana", Size = 16, FontColor = Color.Orange
            };
            Run run1 = new Run(dc, "This is a first line in 1st paragraph!");

            run1.CharacterFormat = cf;
            par1.Inlines.Add(run1);

            // Let's add a line break into the 1st paragraph.
            par1.Inlines.Add(new SpecialCharacter(dc, SpecialCharacterType.LineBreak));
            // Copy the formatting.
            Run run2 = run1.Clone();

            run2.Text = "Let's type a second line.";
            par1.Inlines.Add(run2);

            // Add 2nd paragraph.
            Paragraph par2 = new Paragraph(dc, new Run(dc, "This is a first line in 2nd paragraph.", new CharacterFormat()
            {
                Size = 25, FontColor = Color.Blue, Bold = true
            }));

            section.Blocks.Add(par2);
            SpecialCharacter lBr = new SpecialCharacter(dc, SpecialCharacterType.LineBreak);

            par2.Inlines.Add(lBr);
            Run run3 = new Run(dc, "This is a second line.", new CharacterFormat()
            {
                Size = 20, FontColor = Color.DarkGreen, UnderlineStyle = UnderlineType.Single
            });

            par2.Inlines.Add(run3);

            // Add a graphics figure into the paragraph.
            Shape shape = new Shape(dc, new InlineLayout(new SautinSoft.Document.Drawing.Size(50, 50, LengthUnit.Millimeter)));

            // Specify outline and fill.
            shape.Outline.Fill.SetSolid(new SautinSoft.Document.Color("#358CCB"));
            shape.Outline.Width = 3;
            shape.Fill.SetSolid(SautinSoft.Document.Color.Orange);
            shape.Geometry.SetPreset(Figure.SmileyFace);
            par2.Inlines.Add(shape);

            // Save the document to the file in PDF format.
            dc.Save(docPath, new PdfSaveOptions()
            {
                Compliance = PdfCompliance.PDF_A1a
            });

            // Open the result for demonstration purposes.
            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(docPath)
            {
                UseShellExecute = true
            });
        }
示例#30
0
        /// <summary>
        /// Вставляет текст на закладку с указанным стилем
        /// </summary>
        /// <param name="document"></param>
        /// <param name="bookmarkName">Имя закладки</param>
        /// <param name="text">Вставляемый текст</param>
        /// <param name="format">Формат текста</param>
        public static void InsertToBookmark(this DocumentModel document, string bookmarkName, string text, CharacterFormat format)
        {
            var bookmark = document.Bookmarks.Where(b => b.Name == bookmarkName).FirstOrDefault();

            if (bookmark == null)
            {
                throw new Exception("Не найдена закладка в шаблоне документа");
            }

            var range = bookmark.GetContent(false);

            range.LoadText(text, format);
        }