當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。