Aspose.Words 2月新版v19.2釋出 | 附下載
Aspose.Words 無需Microsoft Word 也可在任何平臺上滿足Word文件的一切操作需求。2019年2月Aspose.Words釋出v19.2,以下是v19.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現已解決:
字型提取和替換機制已更改
以前的字型提取過程是:
- 確切的字型名稱匹配
- 從文件中嵌入字型資料
- 為字型名稱指定的字型替換
- FontInfo中的AltName(如果有)和AltName的替代
- 如果存在FontInfo並且設定了EnableFontSubstitution,則替換字型
- DefaultFontName和DefaultFontName的替代
- 可用字型來源的任何字型
- “Fanwood”字型嵌入到彙編中
現在字型提取過程是:
- 確切的字型名稱匹配
- 從文件中嵌入字型資料
- FontInfo的AltName(如果有的話)
-
字型替換規則
- fontconfig替換
- 表替換字型名稱和alt名稱
- 字型資訊替換
- 預設字型替換
- 可用字型來源的任何字型
- “Fanwood”字型嵌入到彙編中
為字型替換設定添加了新的公共API。與字型替換相關的之前的API方法/屬性已過時
public class FontSettings { /// <summary> /// Settings related to font substitution mechanism. /// </summary> public FontSubstitutionSettings SubstitutionSettings { get; } [Obsolete("This property is obsolete. Please use SubstitutionSettings.DefaultFontSubstitution instead.")] public string DefaultFontName { get; set; } [Obsolete("This property is obsolete. Please use SubstitutionSettings.FontInfoSubstitution instead.")] public bool EnableFontSubstitution { get; set; } [Obsolete("This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead.")] public string[] GetFontSubstitutes(string originalFontName); [Obsolete("This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead.")] public void SetFontSubstitutes(string originalFontName, params string[] substituteFontNames); [Obsolete("This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead.")] 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; } /// <summary> /// Settings related to font info substitution rule. /// </summary> public FontInfoSubstitutionRule FontInfoSubstitution { get; } /// <summary> /// Settings related to default font substitution rule. /// </summary> public DefaultFontSubstitutionRule DefaultFontSubstitution { get; } /// <summary> /// Settings related to font config substitution rule. /// </summary> 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(); /// <summary> /// Resets the cache of fontconfig calling results. /// </summary> 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); /// <summary> /// Loads table substitution settings from XML stream. /// </summary> /// <param name="stream">Input stream.</param> public void Load(Stream stream); /// <summary> /// Loads predefined table substitution settings for Windows platform. /// </summary> public void LoadWindowsSettings(); /// <summary> /// Loads predefined table substitution settings for Linux platform. /// </summary> public void LoadLinuxSettings(); /// <summary> /// Saves the current table substitution settings to file. /// </summary> /// <param name="fileName">Output file name.</param> public void Save(string fileName); /// <summary> /// Saves the current table substitution settings to stream. /// </summary> /// <param name="outputStream">Output stream.</param> public void Save(Stream outputStream); /// <summary> /// Returns array containing substitute font names for the specified original font name. /// </summary> /// <param name="originalFontName">Original font name.</param> /// <returns>List of alternative font names.</returns> public IEnumerable<string> GetSubstitutes(string originalFontName); /// <summary> /// Override substitute font names for given original font name. /// </summary> /// <param name="originalFontName">Original font name.</param> /// <param name="substituteFontNames">List of alternative font names.</param> public void SetSubstitutes(string originalFontName, IEnumerable<string> substituteFontNames); /// <summary> /// Override substitute font names for given original font name. /// </summary> /// <param name="originalFontName">Original font name.</param> /// <param name="substituteFontNames">List of alternative font names.</param> public void SetSubstitutes(string originalFontName, params string[] substituteFontNames); /// <summary> /// Adds substitute font names for given original font name. /// </summary> /// <param name="originalFontName">Original font name.</param> /// <param name="substituteFontNames">List of alternative font names.</param> public void AddSubstitutes(string originalFontName, IEnumerable<string> substituteFontNames); /// <summary> /// Adds substitute font names for given original font name. /// </summary> /// <param name="originalFontName">Original font name.</param> /// <param name="substituteFontNames">List of alternative font names.</param> 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屬性。