Exemple #1
0
        public static a.Paragraph SetTextAlignment(this a.Paragraph paragraph, a.TextAlignmentTypeValues textAlignment)
        {
            var paragraphProperties = paragraph.GetFirstChild <a.ParagraphProperties>();

            if (paragraphProperties == null)
            {
                paragraphProperties = new a.ParagraphProperties();
                paragraph.PrependChild(paragraphProperties);
            }
            paragraphProperties.Alignment = textAlignment;
            return(paragraph);
        }
Exemple #2
0
        public static a.Paragraph SetLineSpace(this a.Paragraph paragraph, float heightMultiplier)
        {
            var paragraphProperties = paragraph.GetFirstChild <a.ParagraphProperties>();

            if (paragraphProperties == null)
            {
                paragraphProperties = new a.ParagraphProperties();
                paragraph.PrependChild(paragraphProperties);
            }
            paragraphProperties.LineSpacing = new a.LineSpacing(new a.SpacingPercent()
            {
                Val = (int)(heightMultiplier * 100000)
            });
            return(paragraph);
        }