Aspose.Words是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。
Aspose API支持流行文件格式处理,并允许将各类文档导出或转换为固定布局文件格式和最常用的图像/多媒体格式。
Aspose.words 最新下载
https://www.evget.com/product/564/download
Aspose技术交流群(761297826)
使用 Word 文档的原始版本和修订版本

修订(跟踪更改)是 Word 文档跟踪您在文档中所做更改的一种方式。我们在此版本中添加了新功能,以处理文档的原始版本和修订版本。为此功能添加了新属性 Document.RevisionsView 以及 RevisionsView 枚举。此属性用于获取或设置一个值,该值指示是使用文档的原始版本还是修订版本。以下代码示例显示了如何使用文档的修订版本。
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET
Document doc = new Document(dataDir + "Test.docx");
doc.UpdateListLabels();
// Switch to the revised version of the document.
doc.RevisionsView = RevisionsView.Final;
foreach (Revision revision in doc.Revisions)
{
if (revision.ParentNode.NodeType == NodeType.Paragraph)
{
Paragraph paragraph = (Paragraph)revision.ParentNode;
if (paragraph.IsListItem)
{
// Print revised version of LabelString and ListLevel.
Console.WriteLine(paragraph.ListLabel.LabelString);
Console.WriteLine(paragraph.ListFormat.ListLevel);
}
}
}
定义图表系列数据标签的默认选项
您可能在 Word 文档中使用过图表系列的数据标签。数据标签使图表更易于理解,因为它们显示了数据系列或单个数据点的详细信息。您可以根据需要向图表系列添加标签。我们在 ChartDataLabelCollection 类中添加了新属性,例如 ShowSeriesName、ShowPercentage、ShowLegendKey、ShowBubbleSize、ShowCategoryName 等。您可以使用这些属性来设置数据标签的默认选项。以下代码示例显示了如何使用这些属性。
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertChart(ChartType.Pie, 432, 252);
Chart chart = shape.Chart;
chart.Series.Clear();
ChartSeries series = chart.Series.Add("Series 1",
new string[] { "Category1", "Category2", "Category3" },
new double[] { 2.7, 3.2, 0.8 });
ChartDataLabelCollection labels = series.DataLabels;
labels.ShowPercentage = true;
labels.ShowValue = true;
labels.ShowLeaderLines = false;
labels.Separator = " - ";
doc.Save(dataDir + "Demo.docx");
以上便是本篇文章的所有内容,要是您还有其他关于产品方面的问题,欢迎咨询我们,或者加入我们官方技术交流群。



















