翻譯|產品更新|編輯:李顯亮|2019-06-04 14:32:37.267|閱讀 612 次
概述:Aspose.Words for Java更新至v19.5版本,添加了Jdk1.6構建選項,部分類型任務的Mailmerge性能提高到50%。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.Words for Java是一種高級Java Word處理API,使您可以直接在Java應用程序中執行各種文檔處理任務。
Aspose.Words for Java更新至v19.5,新增Jdk1.6構建選項,部分類型任務的Mailmerge性能提高了50%,修復多像Bug!
【點擊下載最新版Aspose.Words for Java】
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 | Aspose.Words在將文本文件渲染為Pdf時掛起 | 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修復 |
? ? ? ? ? ?
更多更新細則可參考【Aspose.Words for Java v19.5更新說明】
在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。
////// 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}");
受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("Multi\rLine\rText", 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類,允許從流中加載字體:
////// 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"); } }
添加了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正版授權,可聯系
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn