Aspose.Words for .Net更新至新版本v20.12,此常规的每月版本中有107项改进和修复,实现与.NET 5.0一起使用,欢迎下载体验。
Aspose.Words for.Net是一种高级Word文档处理API,用于执行各种文档管理和操作任务。API支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word。2020年最后一次更新来啦,.NET版Aspose.Words更新至v20.12新版本!
主要特点如下:
- 验证了Aspose.Words for .NET Standard可在.NET 5.0中工作。
- 增加了在保存文档时嵌入PostScript Fonts的功能。
- 实现了条件评估扩展点。
- 为LINQ Reporting Engine提供了一个从动态插入的文档中导入样式的选项。
>>你可以点击这里下载Aspose.Words for .NET v20.12测试体验。(安装包仅提供部分功能,并设置限制,如需试用完整功能请申请免费授权)
17周年庆来啦!整合所有格式API处理控件Aspose.Total永久授权正在火热促销中,新购乐享85折起!联系客服立马1分钟了解全部咨询!
具体更新内容
序 | 概要 | 类别 |
WORDSNET-16895 | 添加功能以使用DOM插入样式分隔符 | 新功能 |
WORDSNET-20552 | LINQ Reporting Engine-提供一种从动态插入的文档中导入样式的方法 | 新功能 |
WORDSNET-18827 | 添加选项以在加载文档时执行内存优化 | 新功能 |
WORDSNET-21432 | 检查Aspose.Words for .NET Standard是否可与.NET 5.0一起使用 | 新功能 |
WORDSNET-21102 | 添加功能以将插入的SVG导出为媒体文件夹中的SVG | 新功能 |
WORDSNET-21441 | 提供对常见的StructuredDocumentRangeStart属性的访问 | 新功能 |
WORDSNET-11665 | 新功能 | |
WORDSNET-18804 | 应该考虑dataLabel extLst中的ManualLayout设置 | 增强功能 |
WORDSNET-3863 | 考虑公开FontAttr.SpecialHidden属性 | 增强功能 |
WORDSNET-12430 | 在转换的DOCX中未激活单词拼写检查器 | 增强功能 |
WORDSNET-14063 | ODT到PDF的转换与表的呈现有关 | 增强功能 |
完整更新细则请参考:【Aspose.Words for .NET v20.12更新说明】
新功能解析
①添加了新的公共属性SaveOptions.AllowEmbeddingPostScriptFonts(WORDSNET-21120)
添加了一个新的公共属性SaveOptions.AllowEmbeddingPostScriptFonts:

用例:
const string testDir = "\TestDir\";Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);// Create some content that will use PostScript font.builder.Font.Name = "PostScriptFont";builder.Writeln("Some text with PostScript font.");// Load the font with PostScript to use in the document.FontSourceBase otf = new MemoryFontSource(File.ReadAllBytes(testDir + "PostScriptFont.otf"));FontSourceBase[] sources = new FontSourceBase[] {otf};doc.FontSettings = new FontSettings();doc.FontSettings.SetFontsSources(sources);// Embed TrueType fonts.doc.FontInfos.EmbedTrueTypeFonts = true;// Allow embedding PostScript fonts while embedding TrueType fonts.SaveOptions saveOptions = SaveOptions.CreateSaveOptions(SaveFormat.Docx);saveOptions.AllowEmbeddingPostScriptFonts = true;// Save document with embedded PostScript font.doc.Save(testDir + "out.docx", saveOptions);
②插入SVG图像时更改了DocumentBuilder.InsertImage行为
插入SVG时,我们更改了DocumentBuilder.InsertImage行为。较早的Aspose.Words将SVG插入为EMF图元文件,以使插入的图像保持在矢量表示中。现在,AW将SVG插入为带有svgBlip扩展名的PNG,其中包含原始SVG图像,就像MS Word一样。
用例1:SVG图像以svgBlip扩展名的PNG格式插入到文档中,其中包含原始矢量SVG图像表示形式。
Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.InsertImage("test.svg");doc.Save("out.docx");
用例2:像MS Word一样,SVG图像以PNG格式保存到输出文档。
Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.InsertImage("test.svg");doc.Save("out.doc");
用例3:使用OptimizeFor方法针对旧版本的MS Word优化了文档。SVG作为EMF图元文件插入文档中,以使图像保持矢量表示形式(旧的Aspose.Word行为)。
Document doc = new Document();doc.CompatibilityOptions.OptimizeFor(Settings.MsWordVersion.Word2003);DocumentBuilder builder = new DocumentBuilder(doc);builder.InsertImage("test.svg");doc.Save("out.doc");
③实施条件评估扩展点
实现了条件评估的扩展点。这使用户可以对IF和COMPARE字段实施自定义评估。


用例:
public class ComparisonExpressionEvaluator : IComparisonExpressionEvaluator{public ComparisonExpressionEvaluator(ComparisonEvaluationResult result){mResult = result;}public ComparisonEvaluationResult Evaluate(Field field, ComparisonExpression expresion){return mResult;}private readonly ComparisonEvaluationResult mResult;}ComparisonEvaluationResult result = new ComparisonEvaluationResult(true);ComparisonExpressionEvaluator evaluator = new ComparisonExpressionEvaluator(result);document.FieldOptions.ComparisonExpressionEvaluator = evaluator;
还想要更多吗可以点击阅读【2020 · Aspose最新资源整合】,查找需要的教程资源。如果您有任何疑问或需求,请随时加入Aspose技术交流群(),我们很高兴为您提供查询和咨询。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!