Aspose.Words无需 Microsoft Word 也可在任何平台上满足 Word 文档的一切操作需求。2019 年 2 月 Aspose.Words 发布 v19.2,以下是 v19.2 更新说明:

                                      【Aspose.Words 19.2 试用版下载

核心 概述 类别
WORDSNET-14532 改进字体替换 API 新增功能
WORDSNET-16111 LINQ 报告中的错误处理 新增功能
WORDSNET-15203 当 LINQ 报告语法不正确时,添加更多有用的异常消息 新增功能
WORDSNET-17047 ActiveX 控件渲染 // 保存为 PDF 时,单选按钮呈锯齿状 增强
WORDSNET-17725 从 HTML 导入后,Border 的宽度为零 增强
WORDSNET-11331 从 DOCX 转换为 DOC/PDF 出现空行 增强
WORDSNET-17405 文本将呈现到下一页 增强
WORDSNET-14851 PDF 中的布局与 WORD 文档中的布局不同 增强
WORDSNET-15008 表格内容与页脚重叠,不会转到 PDF 格式的下一页 增强
WORDSNET-16413 内容控件在输出 PDF 中显示在下一个 增强
WORDSNET-17532 单元格中断包含在下一页 增强
WORDSNET-13756 为 ReportingEngine.BuildReport 抛出有意义的异常 增强
WORDSNET-17950 从 Aspose.Words.Tests 中提取常用测试代码 增强
WORDSNET-17809 ReportingEngine.buildReport 抛出 java.lang.IllegalStateException 增强
WORDSNET-17404 内容将下推到输出 PDF 中的下一页 增强
WORDSNET-18018 DOC / X 到 PDF - 消耗大量内存并占用太多时间 性能
WORDSNET-17911 加载大 ODT 文件会占用太多时间 性能
... ... ...

公共 API 和向后不兼容的更改

这里列出了 Aspose.Words 19.2 中引入的公共 API 更改。它不仅包括新的和过时的公共方法,还包括对 Aspose.Words 中幕后行为的任何变化的描述,这可能会影响现有代码。引入的任何行为都可以被可能修改现有行为,这一点尤为重要,并在此处进行了说明。

调整当保存为 PDF 时,图像处理问题的警告信息

WORDSNET-17338 已经被解决

以前有一个通用警告文本“不支持的图像格式”。现在有一个针对 OutOfMemoryException 的特定警告,文本“没有足够的内存来加载图像”。以及带有文字的通用警告“无法处理图像。可能不支持的图像格式”。

字体替换过程和公共 API 的更改

WORDSNET-14532 现已解决:

字体提取和替换机制已更改

以前的字体提取过程是:

  1. 确切的字体名称匹配
  2. 从文档中嵌入字体数据
  3. 为字体名称指定的字体替换
  4. FontInfo 中的 AltName(如果有)和 AltName 的替代
  5. 如果存在 FontInfo 并且设置了 EnableFontSubstitution,则替换字体
  6. DefaultFontName 和 DefaultFontName 的替代
  7. 可用字体来源的任何字体
  8. “Fanwood”字体嵌入到汇编中

现在字体提取过程是:

  1. 确切的字体名称匹配
  2. 从文档中嵌入字体数据
  3. FontInfo 的 AltName(如果有的话)
  4. 字体替换规则
    • fontconfig 替换
    • 表替换字体名称和 alt 名称
    • 字体信息替换
    • 默认字体替换
  5. 可用字体来源的任何字体
  6. “Fanwood”字体嵌入到汇编中

为字体替换设置添加了新的公共 API。与字体替换相关的之前的 API 方法 / 属性已过时

public class FontSettings
{
    /// <summary>
    /// Settings related to font substitution mechanism.
    /// </summary>
    public FontSubstitutionSettings SubstitutionSettings
    { get; }
[Obsolete(<span class="hljs-string">"This property is obsolete. Please use SubstitutionSettings.DefaultFontSubstitution instead."</span>)]
public string DefaultFontName
{ get; <span class="hljs-built_in">set</span>; }
      
[Obsolete(<span class="hljs-string">"This property is obsolete. Please use SubstitutionSettings.FontInfoSubstitution instead."</span>)]
public bool EnableFontSubstitution
{ get; <span class="hljs-built_in">set</span>; }

[Obsolete(<span class="hljs-string">"This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead."</span>)]
public string[] GetFontSubstitutes(string originalFontName);
      
[Obsolete(<span class="hljs-string">"This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead."</span>)]
public void SetFontSubstitutes(string originalFontName, params string[] substituteFontNames);
      
[Obsolete(<span class="hljs-string">"This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead."</span>)]
public void AddFontSubstitutes(string originalFontName, params string[] substituteFontNames);

}

/// <summary>
/// Specifies font substitution mechanism settings.
/// </summary>
/// <remarks>
/// <para>
/// Font substitution process consists of several rules which are checked one by one in specific order.
/// If the first rule can’t resolve the font then second rule is checked and so on.</para>
/// <para>The order of the rules is following:
/// 1. Font config substitution rule (disabled by default)
/// 2. Table substitution rule (enabled by default)
/// 3. Font info substitution rule (enabled by default)
/// 4. Default font rule (enabled by default)
/// </para>
/// <para>
/// Note that font info substitution rule will always resolve the font if <see cref=“FontInfo”/> is available
/// and will override the default font rule. If you want to use the default font rule then you should disable the
/// font info substitution rule.
/// </para>
/// <para>
/// Note that font config substitution rule will resolve the font in most cases and thus overrides all other rules.
/// </para>
/// </remarks>
public class FontSubstitutionSettings
{
/// <summary>
/// Settings related to table substitution rule.
/// </summary>
public TableSubstitutionRule TableSubstitution
{get;}

/// &lt;summary&gt;
/// Settings related to font info substitution rule.
/// &lt;/summary&gt;
public FontInfoSubstitutionRule FontInfoSubstitution
{ get; }

/// &lt;summary&gt;
/// Settings related to default font substitution rule.
/// &lt;/summary&gt;
public DefaultFontSubstitutionRule DefaultFontSubstitution
{ get; }

/// &lt;summary&gt;
/// Settings related to font config substitution rule.
/// &lt;/summary&gt;
public FontConfigSubstitutionRule FontConfigSubstitution
{ get; }

}

/// <summary>
/// This is an abstract base class for the font substitution rule.
/// </summary>
public abstract class FontSubstitutionRule
{
/// <summary>
/// Specifies whether the rule is enabled or not.
/// </summary>
public bool Enabled
{get; set;}
}

/// <summary>
/// Font config substitution rule.
/// </summary>
/// <remarks>
/// <para>
/// This rule uses fontconfig utility on Linux (and other Unix-like) platforms to get the substitution
/// if the original font is not available.
/// </para>
/// <para>
/// If fontconfig utility is not available then this rule will be ignored.
/// </para>
/// </remarks>
public class FontConfigSubstitutionRule : FontSubstitutionRule
{
/// <summary>
/// Check if fontconfig utility is available or not.
/// </summary>
public bool IsFontConfigAvailable();

/// &lt;summary&gt;
/// Resets the cache of fontconfig calling results.
/// &lt;/summary&gt;
public void ResetCache();

}

/// <summary>
/// Table font substitution rule.
/// </summary>
/// <remarks>
/// This rule defines the list of substitute font names to be used if the original font is not available.
/// Substitutes will be checked for the font name and the <see cref=“FontInfo.AltName”/> (if any).
/// </remarks>
public class TableSubstitutionRule : FontSubstitutionRule
{
/// <summary>
/// Loads table substitution settings from XML file.
/// </summary>
/// <param name=“fileName”>Input file name.</param>
public void Load(string fileName);

/// &lt;summary&gt;
/// Loads table substitution settings from XML stream.
/// &lt;/summary&gt;
/// &lt;param name="stream"&gt;Input stream.&lt;/param&gt;
public void Load(Stream stream);

/// &lt;summary&gt;
/// Loads predefined table substitution settings for Windows platform.
/// &lt;/summary&gt;
public void LoadWindowsSettings();
      
/// &lt;summary&gt;
/// Loads predefined table substitution settings for Linux platform.
/// &lt;/summary&gt;
public void LoadLinuxSettings();

/// &lt;summary&gt;
/// Saves the current table substitution settings to file.
/// &lt;/summary&gt;
/// &lt;param name="fileName"&gt;Output file name.&lt;/param&gt;
public void Save(string fileName);
      
/// &lt;summary&gt;
/// Saves the current table substitution settings to stream.
/// &lt;/summary&gt;
/// &lt;param name="outputStream"&gt;Output stream.&lt;/param&gt;
public void Save(Stream outputStream);

/// &lt;summary&gt;
/// Returns array containing substitute font names for the specified original font name.
/// &lt;/summary&gt;
/// &lt;param name="originalFontName"&gt;Original font name.&lt;/param&gt;
/// &lt;returns&gt;List of alternative font names.&lt;/returns&gt;
public IEnumerable&lt;string&gt; GetSubstitutes(string originalFontName);
    
/// &lt;summary&gt;
/// Override substitute font names for given original font name.
/// &lt;/summary&gt;
/// &lt;param name="originalFontName"&gt;Original font name.&lt;/param&gt;
/// &lt;param name="substituteFontNames"&gt;List of alternative font names.&lt;/param&gt;
public void SetSubstitutes(string originalFontName, IEnumerable&lt;string&gt; substituteFontNames);

/// &lt;summary&gt;
/// Override substitute font names for given original font name.
/// &lt;/summary&gt;
/// &lt;param name="originalFontName"&gt;Original font name.&lt;/param&gt;
/// &lt;param name="substituteFontNames"&gt;List of alternative font names.&lt;/param&gt;
public void SetSubstitutes(string originalFontName, params string[] substituteFontNames);
      
/// &lt;summary&gt;
/// Adds substitute font names for given original font name.
/// &lt;/summary&gt;
/// &lt;param name="originalFontName"&gt;Original font name.&lt;/param&gt;
/// &lt;param name="substituteFontNames"&gt;List of alternative font names.&lt;/param&gt;
public void AddSubstitutes(string originalFontName, IEnumerable&lt;string&gt; substituteFontNames);

/// &lt;summary&gt;
/// Adds substitute font names for given original font name.
/// &lt;/summary&gt;
/// &lt;param name="originalFontName"&gt;Original font name.&lt;/param&gt;
/// &lt;param name="substituteFontNames"&gt;List of alternative font names.&lt;/param&gt;
public void AddSubstitutes(string originalFontName, params string[] substituteFontNames);

}

/// <summary>
/// Font info substitution rule.
/// </summary>
/// <remarks>
/// According to this rule Aspose.Words evaluates all the related fields in <see cref=“FontInfo”/> (Panose, Sig etc) for
/// the missing font and finds the closest match among the available font sources. If <see cref=“FontInfo”/> is not
/// available for the missing font then nothing will be done.
/// </remarks>
public class FontInfoSubstitutionRule : FontSubstitutionRule
{ }

/// <summary>
/// Default font substitution rule.
/// </summary>
/// <remarks>
/// This rule defines single default font name to be used for substitution if the original font is not available.
/// </remarks>
public class DefaultFontSubstitutionRule : FontSubstitutionRule
{
/// <summary>
/// Gets or sets the default font name.
/// </summary>
/// <remarks>
/// <para>The default value is ‘Times New Roman’.</para>
/// </remarks>
public string DefaultFontName
{get; set;}
}
复制代码


删除了不推荐使用的公共属性 TxtSaveOptions.ExportHeadersFooters

问题:WORDSNET-17560

删除已弃用的公共属性 TxtSaveOptions.ExportHeadersFooters:

// Specifies whether to output headers and footers when exporting in plain text format.// Default value is true.public bool ExportHeadersFooters复制代码

请改用 TxtSaveOptions.ExportHeadersFootersMode 属性。

点击查看完整更新内容


  • 设计

    看到很多关于设计趋势的文章,然而作为 UI 设计师,不要麻木追求这些设计手法。选择最适合产品的才是最重要的。

    26 引用 • 1 关注
感谢    赞同    分享    收藏    关注    反对    举报    ...