/// <summary>
        /// Returns a OpenXMl paragraph representing formatted listItem.
        /// </summary>
        /// <param name="item">listItem object</param>
        /// <param name="numStyleId">style id to use</param>
        /// <returns></returns>
        private static Paragraph GetListItem(Model.ListItem item, int numStyleId)
        {
            Paragraph listItemPara = new Paragraph();

            ParagraphProperties paraProps = new ParagraphProperties();

            NumberingProperties numberingProps = new NumberingProperties();
            NumberingLevelReference numberingLevelReference = new NumberingLevelReference() { Val = 0 };

            NumberingId numberingId = new NumberingId() { Val = numStyleId };

            numberingProps.Append(numberingLevelReference);
            numberingProps.Append(numberingId);
            paraProps.Append(numberingProps);

            Run listRun = new Run();
            Text listItemText = new Text()
            {
                Text = item.Body
            };
            listRun.Append(listItemText);

            listItemPara.Append(paraProps);
            listItemPara.Append(listRun);

            return listItemPara;
        }
        public static IT.Chunk GetFormattedText(Text text)
        {
            IT.Chunk formattedChuck = new IT.Chunk(text.TextContent);
            formattedChuck.Font = GetFormattedFont(text.Font);

            return formattedChuck;
        }
        public static OpenXmlElement GetFormattedElement(Model.Text text)
        {
            Text docText = new Text(text.TextContent);
            Run run = new Run();
            RunProperties runProp = CreateRun(text);

            if (runProp != null) run.Append(runProp);
            run.Append(docText);

            return run;
        }
 private static IT.IElement GetElement(Text text)
 {
     Paragraph para = new Paragraph(text);
     IT.Paragraph formatted = ParagraphFormatter.GetFormattedParagraph(para);
     return formatted;
 }
Esempio n. 5
0
 public Paragraph(Text[] parts)
 {
     contents = new List<Element>(parts);
 }
Esempio n. 6
0
 public Paragraph(Text text)
     : this()
 {
     contents.Add(text);
 }
Esempio n. 7
0
 public void AddPart(Text part)
 {
     contents.Add(part);
 }
Esempio n. 8
0
 private void AddElement(Text text, PDF.MultiColumnText columns)
 {
     Paragraph para = new Paragraph(text);
     IT.Paragraph formatted = ParagraphFormatter.GetFormattedParagraph(para);
     AddToDocument(formatted, columns);
 }
Esempio n. 9
0
 public void AddElement(Text text)
 {
     elements.Add(text);
 }
Esempio n. 10
0
 public TableCell(Text text)
     : this()
 {
     elements.Add(text);
 }