本文整理汇总了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());
}
}
示例2: SetParagraph
public void SetParagraph(XWPFParagraph p)
{
if (ctTc.SizeOfPArray() == 0) {
ctTc.AddNewP();
}
ctTc.SetPArray(0, p.GetCTP());
}
示例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.)
*/
}
示例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;
}
示例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);
}
}