Aspose.Words for Java更新至新版本v20.12,此常规的每月版本中,116项改进和修复,一起来看看吧!
随着.NET版Aspose.Words for .Net v20.12的发布,Java版也随之更新,除了一些通用功能外,也独有新改善。
Aspose.Words for Java是一种高级Java Word处理API,使您可以直接在Java应用程序中执行各种文档处理任务,无需Microsoft Word即可生成,修改和转换文档。
主要特点如下:
- 使用Harfbuzz插件改进了阿拉伯字体的呈现。
- 添加了一种允许在保存文档中嵌入PostScript字体的功能。
- 实施条件评估扩展点。
- 提供了从LINQ Reporting Engine的动态插入文档中导入样式的选项。
>>你可以点击这里下载Aspose.Words for Java v20.12测试体验。
新增与改善
键 | 概要 | 类别 |
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拼写检查器 | 增强功能 |
WORDSNET-14063 | ODT到PDF的转换与表的呈现有关 | 增强功能 |
WORDSJAVA-1937 | SVG圆形和方形 | Bug修复 |
WORDSJAVA-2105 | 在SVG圆形盖中实现重叠的破折 线段。 | Bug修复 |
WORDSJAVA-2107 | 移除SVG仪表板盖中的尾部仪表板段。 | Bug修复 |
WORDSJAVA-2234 | /高级字体/ DOCM到迪拜字体的PDF转换问题 | Bug修复 |
WORDSJAVA-2438 | 某些字符未呈现或宽度不正确(Harfbuzz) | Bug修复 |
WORDSJAVA-2459 | / harfbuzz +特定于Java /阿拉伯语WORDSNET和字体的部分呈现在PDF格式中不正确 | Bug修复 |
WORDSJAVA-2491 | 无法从DOCX读取表格样式页边距 | Bug修复 |
WORDSJAVA-2494 | StreamFontSource无法扩展。 | Bug修复 |
WORDSJAVA-2495 | Javadoc是在某些Maven环境中自动加载的。 | Bug修复 |
17周年庆来啦!整合所有格式API处理控件Aspose.Total永久授权火热促销中,新购乐享85折起!联系客服立马1分钟了解全部!
新功能解析
①添加了新的公共属性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进行处理,非常感谢!