Aspose.Words for Java更新至v19.5版本,添加了Jdk1.6构建选项,部分类型任务的Mailmerge性能提高到50%。
Aspose.Words for Java是一种高级Java Word处理API,使您可以直接在Java应用程序中执行各种文档处理任务。
Aspose.Words for Java更新至v19.5,新增Jdk1.6构建选项,部分类型任务的Mailmerge性能提高了50%,修复多像Bug!
【最新版Aspose.Words for Java】
新版特色
- 添加了Jdk1.6构建选项
- Docx-to-Pdf性能优化:冷启动时间从20%降至3倍,具体取决于应用
- Docx-to-Pdf性能优化:根据应用,温度测试时间从2倍提高到10倍
- 对于特定类型的任务,Mailmerge性能提高了50%
- 删除了与FontSettings类中的字体替换设置相关的过时属性和方法
- 实现了StreamFontSource类,允许从流中加载字体
- 在呈现PDF时实现TOC到逻辑结构导出
- 当不同的字体子集具有相同的内部名称时,在PDF中实现嵌入字体的正确呈现
- 在DrawingML图表的系列类别的字符串值中以“x ….”格式的文本呈现为与指定字符代码对应的字符串
- 改进了元文件到XPS的渲染
- 修复了在将复杂渐变填充渲染为PDF时导致异常的错误
- 修复了在渲染时同时应用3D效果和柔化边缘效果时导致形状丢失的错误
- 修复了使用 格线渲染DrawingML图表时出现异常的错误
具体更新内容
key | 概述 | 类别 |
---|---|---|
WORDSNET-14297 | 提供一种方法来检查是否应用了特定的Dml文本效果 | 新功能 |
WORDSNET-16739 | 提供类似于FileFontSource的StreamFontSource | 新功能 |
WORDSNET-16734 | 添加功能以获取“运行”节点的字体前导/度量标准 | 新功能 |
WORDSNET-18436 | 提供API以识别样式分隔符段落 | 新功能 |
WORDSNET-17843 | 为PDF格式的目录生成 | 新功能 |
WORDSNET-18440 | 向ExtrusionParameters添加新的3D参数及其处理 | 新功能 |
WORDSJAVA-1866 | 用尽了与Pdf不匹配的颜色组件数量的图像,用尽Java堆空间。 | Bug修复 |
WORDSJAVA-2010 | 将DOCX转换为PDF的时间消耗 | Bug修复 |
WORDSJAVA-2012 | 邮件合并的时间消耗 | Bug修复 |
WORDSJAVA-2039 | 错误的带有损坏的base64字符串的WML文档中的ImageBytes。 | Bug修复 |
WORDSJAVA-2059 | Aspose.Words for Java 19.3和JDK 1.6引发异常 | Bug修复 |
WORDSJAVA-2063 | 标题中的表格/图像消失,文本框在转换的DOCX中部分可见 | Bug修复 |
WORDSJAVA-2079 | 签名.doc文件后,Aspose.Words 19.4 OutputStream对象为空。 | Bug修复 |
WORDSJAVA-2080 | 当DOC_PRE_WORD_60用作参数时,无法加载Word 6或Word 95格式。 | Bug修复 |
WORDSNET-11952 | 将Html转换为Pdf时的性能问题 | Bug修复 |
WORDSNET-18097 | XML中的图片偶尔会呈现为PDF中的红十字 | Bug修复 |
WORDSNET-13463 | 加入RTF文件后,列表级别的起始编 会更改 | Bug修复 |
WORDSNET-18332 | 图表x-scale在PDF中有字体问题 | Bug修复 |
WORDSNET-18444 | 加载MHTML文件时会引发异常 | Bug修复 |
WORDSNET-17401 | 保存为pdfA1a不支持TOC和TOC项目(TOCI)标记 | Bug修复 |
WORDSNET-18355 | 导入MHTML时抛出System.NotSupportedException | Bug修复 |
WORDSNET-18512 | 外语使用表格按原始文档的顺序转换文档 | Bug修复 |
WORDSNET-18446 | DOCX到PDF – 连字符不一样 | Bug修复 |
WORDSNET-18380 | Document.UpdateFields抛出System.InvalidOperationException | Bug修复 |
WORDSNET-7452 | Bug修复 | |
WORDSNET-7588 | 在加载使用Aspose.Email生成的MHTML文件时,AW挂起 | Bug修复 |
WORDSNET-18395 | 表格加入PDF输出 | Bug修复 |
WORDSNET-18386 | 将RTF转换为PDF时的IndexOutOfRangeException | Bug修复 |
WORDSNET-17383 | FontSettings.SetFontSubstitutes不替换字体 | Bug修复 |
WORDSNET-10368 | 将Docx转换为Pdf时的性能问题 | Bug修复 |
WORDSNET-10867 | Document.Save方法需要花费时间将Docx转换为Pdf | Bug修复 |
WORDSNET-3738 | 如果文档只包含一个包含大量换行符的段落,则渲染需要很长时间 | Bug修复 |
WORDSNET-18171 | 加载MHTML时抛出System.NotSupportedException | Bug修复 |
WORDSNET-18237 | 数学公式标签mi将变为斜体 | Bug修复 |
WORDSNET-18357 | 引入Field.DisplayResult属性以获取假结果 | Bug修复 |
WORDSNET-17407 | 表的右边缘未正确呈现在HTML中 | Bug修复 |
WORDSNET-18307 | “不是合法的OleAut日期”DOCX到DOC或PDF转换时发生异常 | Bug修复 |
WORDSNET-12431 | 将Word保存为Pdf时标题的间距错误 | Bug修复 |
WORDSNET-18448 | 在调用UpdateFields之后,表列表在PDF中添加了延续条目 | Bug修复 |
WORDSNET-12539 | 目录在输出PDF中放错了位置 | Bug修复 |
WORDSNET-13691 | 由于右缩进,带有右选项卡的段落将换行到下一行 | Bug修复 |
WORDSNET-13788 | 从Word转换为PDF有一些页眉/页脚问题 | Bug修复 |
/span>
更多更新细则可参考【Aspose.Words for Java v19.5更新说明】
Aspose.PDF for C ++ 19.5中的公共API更改
▲添加了一个新的重载AppendDocument()方法以及其他ImportFormatOptions参数
在Document类中添加了一个新的重载AppendDocument()方法:
////// Appends the specified document to the end of this document.//////The document to append.///Specifies how to merge style formatting that clashes.///Allows to specify options that affect formatting of a result document.public void AppendDocument(Document srcDoc, ImportFormatMode importFormatMode, ImportFormatOptions importFormatOptions)
用例:
Document srcDoc = new Document("source.docx");Document dstDoc = new Document("destination.docx"); ImportFormatOptions options = new ImportFormatOptions();// Specify that if numbering clashes in source and destination documents, then a numbering from the source document will be used.options.KeepSourceNumbering = true;dstDoc.AppendDocument(srcDoc, ImportFormatMode.UseDestinationStyles, importFormatOptions)
▲添加了新的公共属性Paragraph.BreakIsStyleSeparator
在Paragraph类中添加了一个新的公共属性BreakIsStyleSeparator。
////// True if this paragraph break is a Style Separator. A style separator allows one/// paragraph to consist of parts that have different paragraph styles.///public bool BreakIsStyleSeparator
用例:
Paragraph paragraph; if (paragraph.BreakIsStyleSeparator){ // Do smth..}
▲添加功能以获得字体前导(行间距)
字体的行间距是两个连续文本行的基线之间的垂直距离。因此,行间距包括行之间的空白空间以及字符本身的高度。Font类中引入了以下属性以获取此值:
////// Returns line spacing of this font (in points).///public double LineSpacing { get; }
用例:
DocumentBuilder builder = new DocumentBuilder(new Document());builder.Font.Name = "Calibri";builder.Writeln("qText"); // Obtain line spacing.Font font = builder.Document.FirstSection.Body.FirstParagraph.Runs[0].Font;Console.WriteLine($"lineSpacing = {font.LineSpacing}");
▲添加了Field.DisplayResult属性以获取虚假结果
受WORDSNET-18165的启发,添加一个属性,允许客户获取没有字段分隔符节点的字段的字段结果。我们称之为“假结果”或显示结果; MS Word通过动态计算字段的值在文档中显示它,但文档模型中没有这样的值
////// Gets the text that represents the displayed field result.///////// Themethod must be called to obtain correct value for the///,,andfields.///public string DisplayResult
用法:
List Field> fields = FieldExtractor.ExtractToCollection(document, false); Assert.AreEqual("111", fields[0].DisplayResult);Assert.AreEqual("222", fields[1].DisplayResult);Assert.AreEqual("MultirLinerText", fields[2].DisplayResult);Assert.AreEqual("%", fields[3].DisplayResult);Assert.AreEqual("Macro Button Text", fields[4].DisplayResult);Assert.AreEqual(string.Empty, fields[5].DisplayResult); document.UpdateListLabels(); Assert.AreEqual("1)", fields[5].DisplayResult);
▲添加了新的StreamFontSource类
添加了新的StreamFontSource类,允许从流中加载字体:
////// Base class for user-defined stream font source./////////In order to use the stream font source you should create a derived class from the/// and provide implementation of themethod./// ///method could be called several times. For the first time it will be called /// when Aspose.Words scans the provided font sources to get the list of available fonts. Later it may be called if the/// font is used in the document to parse the font data and to embed the font data to some output formats./// ///may be useful because it allows to load the font data only when it is required/// and not to store it in the memory for thelifetime.///public abstract class StreamFontSource : FontSourceBase, IFontData{ ////// Ctor. ///protected StreamFontSource() { } ////// Ctor. //////Font source priority. See theproperty description for more information.protected StreamFontSource(int priority) : base(priority) { } ////// Returns the type of the font source. ///public sealed override FontSourceType Type { get { return FontSourceType.FontStream; } } ////// This method should open the stream with font data on demand. //////Font data stream.////// Aspose.Words will close the stream after reading. There is no need to close it explicitly. ///public abstract Stream OpenFontDataStream(); }
用例:
class ResourceSteamFontSourceExample : StreamFontSource{ public override Stream OpenFontDataStream() { return Assembly.GetExecutingAssembly().GetManifestResourceStream("resourceName"); }}
▲从FontSettings类中删除了与字体替换设置相关的过时属性和方法
- 从FontSettings类中删除了过时的属性DefaultFontName。请改用SubstitutionSettings.DefaultFontSubstitution
- 从FontSettings类中删除了过时的属性EnableFontSubstitution。请改用SubstitutionSettings.FontInfoSubstitution
- 从FontSettings类中删除了过时的方法GetFontSubstitutes,SetFontSubstitutes,AddFontSubstitutes。请改用SubstitutionSettings.TableSubstitution
▲WORDSNET-14297 – 提供检查是否应用特定Dml文本效果的方法
添加了Font.HasDmlEffect()方法以检查特定的Dml文本效果是否应用于Run。
////// Checks if particular Dml text effect is applied.//////Dml text effect type.///True if particular Dml text effect is applied.public bool HasDmlEffect(TextDmlEffect dmlEffectType)
用例:
RunCollection runs = doc.FirstSection.Body.FirstParagraph.Runs; Font runFont = runs[1].Font; // One run might have several Dml text effects applied.Debug.WriteLine(runFont.HasDmlEffect(TextDmlEffect.Shadow));Debug.WriteLine(runFont.HasDmlEffect(TextDmlEffect.Effect3D));Debug.WriteLine(runFont.HasDmlEffect(TextDmlEffect.Reflection));Debug.WriteLine(runFont.HasDmlEffect(TextDmlEffect.Outline));Debug.WriteLine(runFont.HasDmlEffect(TextDmlEffect.Fill));
想要购买Aspose.Words正版授权,可联系客服

标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!