文档半岛外围网上直营>>Aspose中文文档>>在 NPOI 中使用页脚
在 NPOI 中使用页脚
Aspose.Words是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。
Aspose API支持流行文件格式处理,并允许将各类文档导出或转换为固定布局文件格式和最常用的图像/多媒体格式。
Aspose.Words
Document wordDocument = new Document("Convert Word Doc to Other Formats.doc");
HeaderFooterCollection footers = wordDocument.FirstSection.HeadersFooters;
foreach (HeaderFooter footer in footers)
{
if (footer.HeaderFooterType == HeaderFooterType.FooterFirst || footer.HeaderFooterType == HeaderFooterType.FooterPrimary || footer.HeaderFooterType ==
HeaderFooterType.FooterEven)
Console.WriteLine(footer.GetText());
}
点击复制
NPOI
XWPFDocument wordDocument = new XWPFDocument(new FileStream("Working with Footers.doc", FileMode.Open));
IList<XWPFFooter> footers = wordDocument.FooterList;
foreach (XWPFFooter footer in footers)
{
Console.WriteLine(footer.Text);
}
点击复制
下载运行代码
下载示例代码

QQ交谈
在线咨询

渝公网安备
50010702500608号

客服热线