Aspose.Words for .Net更新至新版本v21.4,此常规的每月版本中有95项改进和修复,包括添加了删除未使用的内置样式的功能、扩展了结构化文档标签范围的公共API等新功能,欢迎下载体验。
Aspose.Words for.Net是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。2021年4月更新来啦,.NET版Aspose.Words更新至v21.4新版本!
主要特点如下:
- 添加了删除未使用的内置样式的功能。
- Fill类扩展了用于处理实体填充的功能。
- 扩展了结构化文档标签范围的公共API。
- 当保存到.NET和.NET Standard上的图像时,支持高级字体。
>>你可以点击这里下载Aspose.Words for .NET v21.4测试体验。
整合所有格式API处理控件Aspose.Total永久授权正在火热促销中,联系客服立马1分钟了解全部咨询!
具体更新内容
关键序 | 概括 | 类别 |
WORDSNET-21246 | 在StructuredDocumentTagRangeStart类中提供更多属性/方法 | 新功能 |
WORDSNET-21991 | 在SkiaSharp图像渲染器中支持高级排版 | 新功能 |
WORDSNET-5643 | 在保存为流格式时,考虑提供一种保存用户指定页面范围的方法 | 增强功能 |
WORDSNET-20580 | 改进HTML列表编写器中的列表项填充模拟 | 增强功能 |
WORDSNET-21597 | 为DML形状添加“ IsDecorative”标志 | 增强功能 |
WORDSNET-3449 | 改善对大文件的支持 | 增强功能 |
完整更新细则请参考:【Aspose.Words for .NET v21.4更新说明】
新功能解析
①WORDSNET-21330/21991:当保存到.NET和.NET Standard上的图像时,支持高级排版
使用GDI +或SkiaSharp保存到图像时(即在所有.NET平台和.NET Standard上),现在支持高级字体。用例:使用高级排版功能将文档保存到图像。
Document doc = new Document("input.docx");doc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;doc.Save("output.png");
②WORDSNET-21808:引入Fill.Solid()方法
将以下新的公共方法添加到Fill类中:

用例:说明如何将填充更改为实体。
// Open some document with text effects.Document doc = new Document("TextTwoColorGradient.docx");// Get Fill object for Font of the first Run.Fill fill = doc.FirstSection.Body.FirstParagraph.Runs[0].Font.Fill;// Check Fill properties of the Font.Console.WriteLine("The type of the fill is: {0}", fill.FillType);Console.WriteLine("The foreground color of the fill is: {0}", fill.ForeColor);Console.WriteLine("The fill is transparent at {0}%", fill.Transparency * 100);// Change type of the fill to Solid with uniform green color.fill.Solid(Color.Green);Console.WriteLine("nThe fill is changed:");Console.WriteLine("The type of the fill is: {0}", fill.FillType);Console.WriteLine("The foreground color of the fill is: {0}", fill.ForeColor);Console.WriteLine("The fill transparency is {0}%", fill.Transparency * 100);doc.Save("TextSolidOut.docx");/*This code example produces the following results:The type of the fill is: GradientThe foreground color of the fill is: Color [A=255, R=0, G=128, B=128]The fill is transparent at 65%The fill is changed:The type of the fill is: SolidThe foreground color of the fill is: Color [A=255, R=0, G=128, B=0]The fill transparency is 0%*/
③WORDSNET-21246:扩展了结构化文档标签范围的公共API
StructuredDocumentTagRangeStart和StructuredDocumentTagRangeEnd类的构造函数已公开。现在可以手动创建这些类的实例。

用例:
Document doc = new Document("input.docx");StructuredDocumentTagRangeStart start = new StructuredDocumentTagRangeStart(doc, SdtType.RepeatingSectionItem);StructuredDocumentTagRangeEnd end = new StructuredDocumentTagRangeEnd(doc, start.Id);doc.FirstSection.Body.InsertAfter(start, doc.FirstSection.Body.FirstParagraph);doc.LastSection.Body.InsertBefore(end, doc.LastSection.Body.LastParagraph);doc.Save("output.docx");IEnumerable interface is implemented in StructuredDocumentTagRangeStart class for full LINQ support (i.e. Last(), LastOrDefault() and other methods).Document doc = new Document("input.docx");StructuredDocumentTagRangeStart start = (StructuredDocumentTagRangeStart)doc.FirstSection.Body.GetChild(NodeType.StructuredDocumentTagRangeStart, 0, false);Console.WriteLine(start.LastOrDefault().GetText());
如果你想试用Aspose的全部完整功能,可 联系在线客服获取30天临时授权体验。
还想要更多吗可以点击阅读【2020 · Aspose最新资源整合】,查找需要的教程资源。如果您有任何疑问或需求,请随时加入Aspose技术交流群(),我们很高兴为您提供查询和咨询。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!