示例#1
0
        public void Write(PPTXTextRun Text)
        {
            var lastTextArea = AddTextAreaIfEmpty();

            if (SlideManager.currentSlide.TextAreas.Last().Transform.SizeY > 0)
            {
                AddTextArea();
                lastTextArea = SlideManager.currentSlide.TextAreas.Last();
            }

            if (lastTextArea.Texts.Count == 0)
            {
                lastTextArea.Texts.Add(new PPTXText());
            }

            var lastText = lastTextArea.Texts.Last();

            if (WantReturn)
            {
                lastText = new PPTXText();
                lastTextArea.Texts.Add(lastText);
            }

            Text.Font = SlideManager.CurrentFont;

            if (SlideManager.LinkStack.Count > 0)
            {
                Text.Link = SlideManager.LinkStack.Peek();
            }

            lastText.Texts.Add(Text);

            WantReturn = false;
        }
示例#2
0
        public void AddTextRow(PPTXText Text)
        {
            var lastTextArea = AddTextAreaIfEmpty();

            lastTextArea.Texts.Add(Text);

            WantReturn = false;
        }
示例#3
0
        public static A.ParagraphProperties CrateParagraphProperties(PPTXText Content)
        {
            var paragraphPorp = new A.ParagraphProperties();

            var firstTextRun = Content.Texts.FirstOrDefault();

            if (firstTextRun == null)
            {
                return(paragraphPorp);
            }

            switch (firstTextRun.Font.HAlign)
            {
            case EPPTXHAlign.Left:
                paragraphPorp.Alignment = A.TextAlignmentTypeValues.Left;
                break;

            case EPPTXHAlign.Center:
                paragraphPorp.Alignment = A.TextAlignmentTypeValues.Center;
                break;

            case EPPTXHAlign.Right:
                paragraphPorp.Alignment = A.TextAlignmentTypeValues.Right;
                break;
            }

            switch (Content.Bullet)
            {
            case PPTXBullet.None:
                paragraphPorp.Append(new A.NoBullet());
                break;

            case PPTXBullet.Circle:
                paragraphPorp.Append(new A.BulletFont()
                {
                    Typeface = "Wingdings", Panose = "05000000000000000000", PitchFamily = 2, CharacterSet = 2
                });
                paragraphPorp.Append(new A.CharacterBullet()
                {
                    Char = "l"
                });
                break;

            case PPTXBullet.Rectangle:
                paragraphPorp.Append(new A.BulletFont()
                {
                    Typeface = "Wingdings", Panose = "05000000000000000000", PitchFamily = 2, CharacterSet = 2
                });
                paragraphPorp.Append(new A.CharacterBullet()
                {
                    Char = "n"
                });
                break;

            case PPTXBullet.Diamond:
                paragraphPorp.Append(new A.BulletFont()
                {
                    Typeface = "Wingdings", Panose = "05000000000000000000", PitchFamily = 2, CharacterSet = 2
                });
                paragraphPorp.Append(new A.CharacterBullet()
                {
                    Char = "u"
                });
                break;

            case PPTXBullet.RectangleBorder:
                paragraphPorp.Append(new A.BulletFont()
                {
                    Typeface = "Wingdings", Panose = "05000000000000000000", PitchFamily = 2, CharacterSet = 2
                });
                paragraphPorp.Append(new A.CharacterBullet()
                {
                    Char = "p"
                });
                break;

            case PPTXBullet.Check:
                paragraphPorp.Append(new A.BulletFont()
                {
                    Typeface = "Wingdings", Panose = "05000000000000000000", PitchFamily = 2, CharacterSet = 2
                });
                paragraphPorp.Append(new A.CharacterBullet()
                {
                    Char = "ü"
                });
                break;

            case PPTXBullet.Arrow:
                paragraphPorp.Append(new A.BulletFont()
                {
                    Typeface = "Wingdings", Panose = "05000000000000000000", PitchFamily = 2, CharacterSet = 2
                });
                paragraphPorp.Append(new A.CharacterBullet()
                {
                    Char = "Ø"
                });
                break;

            case PPTXBullet.MiniCircle:
                break;

            case PPTXBullet.Number:
                paragraphPorp.Append(new A.BulletFont()
                {
                    Typeface = "+mj-lt"
                });
                paragraphPorp.Append(new A.AutoNumberedBullet()
                {
                    Type = A.TextAutoNumberSchemeValues.ArabicPeriod
                });
                break;

            case PPTXBullet.CircleNumber:
                paragraphPorp.Append(new A.BulletFont()
                {
                    Typeface = "+mj-ea"
                });
                paragraphPorp.Append(new A.AutoNumberedBullet()
                {
                    Type = A.TextAutoNumberSchemeValues.CircleNumberDoubleBytePlain
                });
                break;
            }

            return(paragraphPorp);
        }
示例#4
0
 public void AddTextRow(PPTXText TextRow)
 {
     Writer.AddTextRow(TextRow);
 }
示例#5
0
 public void AddTextRow(PPTXText Text)
 {
     TextManager.AddTextRow(Text);
 }