当前位置: 首页>>代码示例>>C#>>正文


C# XWPFParagraph.GetCTP方法代码示例

本文整理汇总了C#中NPOI.XWPF.UserModel.XWPFParagraph.GetCTP方法的典型用法代码示例。如果您正苦于以下问题:C# XWPFParagraph.GetCTP方法的具体用法?C# XWPFParagraph.GetCTP怎么用?C# XWPFParagraph.GetCTP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NPOI.XWPF.UserModel.XWPFParagraph的用法示例。


在下文中一共展示了XWPFParagraph.GetCTP方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: XWPFCommentsDecorator

        public XWPFCommentsDecorator(XWPFParagraph paragraph, XWPFParagraphDecorator nextDecorator)
            : base(paragraph, nextDecorator)
        {
            ;

            XWPFComment comment;
            commentText = new StringBuilder();

            foreach (CT_MarkupRange anchor in paragraph.GetCTP().GetCommentRangeStartList())
            {
                if ((comment = paragraph.Document.GetCommentByID(anchor.id)) != null)
                    commentText.Append("\tComment by " + comment.GetAuthor() + ": " + comment.GetText());
            }
        }
开发者ID:WendaoChen,项目名称:npoi,代码行数:14,代码来源:XWPFCommentsDecorator.cs

示例2: SetParagraph

 public void SetParagraph(XWPFParagraph p)
 {
     if (ctTc.SizeOfPArray() == 0) {
         ctTc.AddNewP();
     }
     ctTc.SetPArray(0, p.GetCTP());
 }
开发者ID:89sos98,项目名称:npoi,代码行数:7,代码来源:XWPFTableCell.cs

示例3: SetParagraph

 /**
  * copies content of a paragraph to a existing paragraph in the list paragraphs at position pos
  * @param paragraph
  * @param pos
  */
 public void SetParagraph(XWPFParagraph paragraph, int pos)
 {
     paragraphs[pos]= paragraph;
     ctDocument.body.SetPArray(pos, paragraph.GetCTP());
     /* TODO update body element, update xwpf element, verify that
      * incoming paragraph belongs to this document or if not, XML was
      * copied properly (namespace-abbreviations, etc.)
      */
 }
开发者ID:eatage,项目名称:npoi,代码行数:14,代码来源:XWPFDocument.cs

示例4: ConvertParagraphToTable

 public XWPFTable ConvertParagraphToTable(XWPFParagraph p, int rows, int cols)
 {
     int docpos = bodyElements.IndexOf(p);
     XWPFTable table = new XWPFTable(ctDocument.body.ParagraphToTable(p.GetCTP()), this, rows, cols);
     RemoveBodyElement(docpos);
     bodyElements.Insert(docpos, table);
     tables.Add(table);
     return table;
 }
开发者ID:BertHar,项目名称:npoi,代码行数:9,代码来源:XWPFDocument.cs

示例5: AppendParagraphText

        public void AppendParagraphText(StringBuilder text, XWPFParagraph paragraph)
        {
            try
            {
                CT_SectPr ctSectPr = null;
                if (paragraph.GetCTP().pPr != null)
                {
                    ctSectPr = paragraph.GetCTP().pPr.sectPr;
                }

                XWPFHeaderFooterPolicy headerFooterPolicy = null;

                if (ctSectPr != null)
                {
                    headerFooterPolicy = new XWPFHeaderFooterPolicy(document, ctSectPr);
                    extractHeaders(text, headerFooterPolicy);
                }


                foreach (IRunElement run in paragraph.Runs)
                {
                    text.Append(run.ToString());
                    if (run is XWPFHyperlinkRun && fetchHyperlinks)
                    {
                        XWPFHyperlink link = ((XWPFHyperlinkRun)run).GetHyperlink(document);
                        if (link != null)
                            text.Append(" <" + link.URL + ">");
                    }
                }

                // Add comments
                XWPFCommentsDecorator decorator = new XWPFCommentsDecorator(paragraph, null);
                String commentText = decorator.GetCommentText();
                if (commentText.Length > 0)
                {
                    text.Append(commentText).Append('\n');
                }

                // Do endnotes and footnotes
                String footnameText = paragraph.FootnoteText;
                if (footnameText != null && footnameText.Length > 0)
                {
                    text.Append(footnameText + '\n');
                }

                if (ctSectPr != null)
                {
                    extractFooters(text, headerFooterPolicy);
                }
            }
            catch (IOException e)
            {
                throw new POIXMLException(e);
            }
            catch (XmlException e)
            {
                throw new POIXMLException(e);
            }

        }
开发者ID:hijson,项目名称:npoi,代码行数:60,代码来源:XWPFWordExtractor.cs


注:本文中的NPOI.XWPF.UserModel.XWPFParagraph.GetCTP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。