Пример #1
0
        public static xdr.TextBody SetFont(this xdr.TextBody textBody, Font font, Color?color = null)
        {
            var paragraphs = textBody.Elements <a.Paragraph>();

            foreach (var p in paragraphs)
            {
                p.SetFont(font, color);
            }
            return(textBody);
        }
Пример #2
0
        public static xdr.TextBody SetHorizontalAlignment(this xdr.TextBody textBody, a.TextAlignmentTypeValues textAlignment)
        {
            var paragraphs = textBody.Elements <a.Paragraph>();

            foreach (var p in paragraphs)
            {
                p.SetTextAlignment(textAlignment);
            }
            return(textBody);
        }
Пример #3
0
        public static xdr.TextBody SetLineSpace(this xdr.TextBody textBody, float heightMultiplier)
        {
            var paragraphs = textBody.Elements <a.Paragraph>();

            foreach (var p in paragraphs)
            {
                p.SetLineSpace(heightMultiplier);
            }
            return(textBody);
        }
        public static xdr.TextBody AddText(this xdr.TextBody textBody, string text, Font font = null, Color?fontColor = null)
        {
            var p = textBody.Elements <a.Paragraph>().LastOrDefault();

            if (p == null)
            {
                p = new a.Paragraph();
                textBody.Append(p);
            }
            p.AddText(text, font, fontColor);
            return(textBody);
        }