原創|產品更新|編輯:李顯亮|2021-03-11 10:59:30.497|閱讀 584 次
概述:Aspose.Words for Java更新至新版本v21.3,此常規的每月版本中有94個改進和修補程序,主要功能如下,歡迎下載體驗。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
隨著.NET版Aspose.Words for .Net v21.3的發布,Java版也隨之更新,除了一些通用功能外,也獨有新改善。
Aspose.Words for Java是一種高級Java Word處理API,使您可以直接在Java應用程序中執行各種文檔處理任務,無需Microsoft Word即可生成,修改和轉換文檔。
主要特點如下:
>>你可以點擊這里下載Aspose.Words for Java v21.3測試體驗。
序號 | 概括 | 類別 |
WORDSNET-7788 | 支持Font.Fill屬性,并在API中提供公共成員 | 新功能 |
WORDSNET-17851 | LINQ報表引擎——支持選擇擴展方法 | 新功能 |
WORDSNET-18173 | 實現MERGESEQ領域的全部功能 | 新功能 |
WORDSNET-12810 | 提供bool FontSettings.SetFontsFolder重載 | 新功能 |
WORDSNET-20554 | 支持LINQ報表引擎雙向同時動態合并單元格 | 新功能 |
WORDSNET-21425 | LINQ 報表引擎--支持SelectMany擴展方法 | 新功能 |
WORDSNET-21189 | 增加獲取StructuredocumentTagRangeStart內容的功能 | 新功能 |
WORDSNET-21785 | 從樣式庫中刪除樣式 | 新功能 |
WORDSNET-9676 | Node.NextSibling的錯誤結果 | 增強功能 |
現在,不僅可以從ShapeBase中訪問Fill屬性,還可以從Font對象中訪問該屬性:
此外,以下新的公共屬性已添加到Fill類中:
此外,以下新的公共枚舉已添加到Aspose.Words.Drawing命名空間中:
用例如下:
// Open some document with text effects. const string myDir = @"example\"; Document doc = new Document(myDir + "TextTwoColorGradient.docx"); // Get Fill object for Font of the first Run. Fill fill = doc.FirstSection.Body.FirstParagraph.Runs[0].Font.Fill; // Check Fill properties of the Font. Console.WriteLine("The type of the fill is: {0}", fill.FillType); Console.WriteLine("It is{0} visible.", fill.Visible ? "" : " not"); Console.WriteLine("The foreground color of the fill is: {0}", fill.ForeColor); Console.WriteLine("The background color of the fill is: {0}", fill.BackColor); Console.WriteLine("The fill is transparent at {0}%", fill.Transparency * 100); Console.WriteLine("Note the opacity is opposite to transparency and has value: {0}%", fill.Opacity * 100); // You can change, for example, the foreground color. fill.ForeColor = Color.Yellow; // Or even make it invisible. fill.Visible = false; // But let's make it visible again with foreground color Red. fill.ForeColor = Color.Green; // Note, it now has Solid type with 100% opacity. Console.WriteLine("\nThe fill is changed:"); Console.WriteLine("The type of the fill is: {0}", fill.FillType); Console.WriteLine("The foreground color of the fill is: {0}", fill.ForeColor); Console.WriteLine("The fill opacity is {0}%", fill.Opacity * 100); // Let's also change the transparency. fill.Transparency = 0.25; Console.WriteLine("\nThe fill is changed once again:"); Console.WriteLine("The fill transparency is {0}%", fill.Transparency * 100); doc.Save(myDir + "TextTwoColorGradient Out.docx"); /* This code example produces the following results: The type of the fill is: Gradient It is visible. The foreground color of the fill is: Color [A=255, R=128, G=0, B=0] The background color of the fill is: Color [A=255, R=0, G=0, B=0] The fill is transparent at 16% Note the opacity is opposite to transparency and has value: 84% The fill is changed: The type of the fill is: Solid The foreground color of the fill is: Color [A=255, R=0, G=128, B=0] The fill opacity is 100% The fill is changed once again: The fill transparency is 25% */
以下公共屬性已添加到StructuredDocumentTagRangeStart類:
以下公共方法已添加到StructuredDocumentTagRangeStart類中:
這些更改允許枚舉范圍化結構化文檔標簽的子節點。為了客戶方便,功能遵循CompositeNode模式并返回實時集合。
用例:說明如何使用StructuredDocumentTagRangeStart的子節點
Document doc = new Document("document-containing-ranged-structured-document-tag"); StructuredDocumentTagRangeStart tag = (StructuredDocumentTagRangeStart)doc.FirstSection.Body.FirstChild; Console.WriteLine(tag.ChildNodes.Count); foreach(Node node in tag.ChildNodes) Console.WriteLine(node.NodeType); foreach(Node node in tag.GetChildNodes(NodeType.Run, true)) Console.WriteLine(node.GetText());+
以下公共屬性已添加到FontSourceBase類:
用例:
FontSettings settings = new FontSettings(); settings.SetFontsFolder("bad folder?", false); FontSourceBase source = settings.GetFontsSources()[0]; IWarningCallback wc = new CustomWarningCallback(); source.WarningCallback = wc; IListfontInfos = source.GetAvailableFonts(); Console.WriteLine((wc as IList)[0].Description);
輸出如下:
Error loading font from the folder "bad folder?": Illegal characters in path.
如果你想試用Aspose的全部完整功能,可聯系在線客服獲取30天臨時授權體驗。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn