本帖最后由 mnrssj 于 2021-3-9 11:13 编辑
Aspose.Words for .Net是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。2021年3月更新来啦,.NET版Aspose.Words更新至v21.3新版本! 主要特点如下: - 介绍了StyleCollection类的ClearQuickStyleGallery方法。
- 扩展字体API,用于设置文本的Fill属性。
- 添加了使用StructuredDocumentTagRangeStart的子节点的功能。
- 修复了由于合并了隐藏的段落而导致嵌套的PDF书签的问题。
- 新添LINQ Reporting Engine支持的Select和SelectMany扩展方法。
>>你可以点击这里下载Aspose.Words for .NET v21.3测试体验。 具体更新内容 序号 | 概括 | 类别 | WORDSNET-7788 | 支持Font.Fill属性,并在API中提供公共成员 | 新功能 | WORDSNET-17851 | LINQ报表引擎——支持选择扩展方法 | 新功能 | WORDSNET-18173 | 实现MERGESEQ领域的全部功能 | 新功能 | WORDSNET-12810 | 提供bool FontSettings.SetFontsFolder重载 | 新功能 | WORDSNET-20554 | 支持LINQ报表引擎双向同时动态合并单元格 | 新功能 | WORDSNET-21425 | LINQ 报表引擎--支持SelectMany扩展方法 | 新功能 | WORDSNET-21189 | 增加获取StructuredocumentTagRangeStart内容的功能 | 新功能 | WORDSNET-21785 | 从样式库中删除样式 | 新功能 | WORDSNET-9676 | Node.NextSibling的错误结果 | 增强功能 | 新功能解析
①WORDSNET-7788:扩展字体API设置文本的Fill属性
现在,不仅可以从ShapeBase中访问Fill属性,还可以从Font对象中访问该属性: 此外,以下新的公共属性已添加到Fill类中: 此外,以下新的公共枚举已添加到Aspose.Words.Drawing命名空间中: 用例如下: [C#] 纯文本查看 复制代码 // Open some document with text effects.
const string myDir = @"example\";
Document doc = new Document(myDir + "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("It is{0} visible.", fill.Visible ? "" : " not");
Console.WriteLine("The foreground color of the fill is: {0}", fill.ForeColor);
Console.WriteLine("The background color of the fill is: {0}", fill.BackColor);
Console.WriteLine("The fill is transparent at {0}%", fill.Transparency * 100);
Console.WriteLine("Note the opacity is opposite to transparency and has value: {0}%", fill.Opacity * 100);
// You can change, for example, the foreground color.
fill.ForeColor = Color.Yellow;
// Or even make it invisible.
fill.Visible = false;
// But let's make it visible again with foreground color Red.
fill.ForeColor = Color.Green;
// Note, it now has Solid type with 100% opacity.
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 opacity is {0}%", fill.Opacity * 100);
// Let's also change the transparency.
fill.Transparency = 0.25;
Console.WriteLine("\nThe fill is changed once again:");
Console.WriteLine("The fill transparency is {0}%", fill.Transparency * 100);
doc.Save(myDir + "TextTwoColorGradient Out.docx");
/*
This code example produces the following results:
The type of the fill is: Gradient
It is visible.
The foreground color of the fill is: Color [A=255, R=128, G=0, B=0]
The background color of the fill is: Color [A=255, R=0, G=0, B=0]
The fill is transparent at 16%
Note the opacity is opposite to transparency and has value: 84%
The fill is changed:
The type of the fill is: Solid
The foreground color of the fill is: Color [A=255, R=0, G=128, B=0]
The fill opacity is 100%
The fill is changed once again:
The fill transparency is 25%
*/
②WORDSNET-21189:添加了使用StructuredDocumentTagRangeStart的子节点的功能
以下公共属性已添加到StructuredDocumentTagRangeStart类: 以下公共方法已添加到StructuredDocumentTagRangeStart类中: 这些更改允许枚举范围化结构化文档标签的子节点。为了客户方便,功能遵循CompositeNode模式并返回实时集合。 用例:说明如何使用StructuredDocumentTagRangeStart的子节点 [C#] 纯文本查看 复制代码 Document doc = new Document("document-containing-ranged-structured-document-tag");StructuredDocumentTagRangeStart tag = (StructuredDocumentTagRangeStart)doc.FirstSection.Body.FirstChild; Console.WriteLine(tag.ChildNodes.Count); foreach(Node node in tag.ChildNodes) Console.WriteLine(node.NodeType); foreach(Node node in tag.GetChildNodes(NodeType.Run, true)) Console.WriteLine(node.GetText());+
③WORDSNET-12810:为字体来源添加了警告回调属性
以下公共属性已添加到FontSourceBase类: 用例: FontSettings settings = new FontSettings();settings.SetFontsFolder("bad folder?", false); FontSourceBase source = settings.GetFontsSources()[0];IWarningCallback wc = new CustomWarningCallback();source.WarningCallback = wc; IListfontInfos = source.GetAvailableFonts(); Console.WriteLine((wc 输出如下: Error loading font from the folder "bad folder?": Illegal characters in path. 如果您有任何疑问或需求,请随时加入Aspose技术交流群(761297826),我们很高兴为您提供查询和咨询。
|