Aspose.Words for Java是功能豐富的Word處理API,容許開發人員在不使用Microsoft Word的狀況下嵌入在本身的Java應用程序中生成,修改,轉換,呈現和打印文檔的功能。同時還提供訪問和操做全部文檔元素的格式屬性,高質量轉換爲多種格式,將單個頁面或完整文檔呈現爲不一樣文件格式,使用來自各類數據源或業務對象的數據生成報告等功能。app
Aspose.Words for Java(點擊下載)更新至新版本v19.9,新增基於HarfBuzz整形器的高級排版以及簡化Java上的XML數據源使用,添加對Truncate字體高度兼容性選項的支持,修復多項Bug,咱們一塊兒來看一看新功能詳解吧!字體
▲WORDSNET-12655 - 實現了建立重複節結構化文檔標籤的能力ui
新版本能夠建立重複節的結構化文檔標記節點和重複節項類型。新項目也已添加到SdtType枚舉類型中:spa
public enum SdtType { … ////// The SDT represents repeating section item. ///////// This is MS-specific feature available since Office 2013 and not supported by the ISO/IEC 29500 OOXML standard. ///RepeatingSectionItem, … }
用例建立映射到自定義XML部分的表重複節:xml
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); CustomXmlPart xmlPart = doc.CustomXmlParts.Add("Books", "Everyday ItalianGiada De Laurentiis" + "Harry PotterJ K. Rowling" + "Learning XMLErik T. Ray"); Table table = builder.StartTable(); builder.InsertCell(); builder.Write("Title"); builder.InsertCell(); builder.Write("Author"); builder.EndRow(); builder.EndTable(); StructuredDocumentTag repeatingSectionSdt = new StructuredDocumentTag(doc, SdtType.RepeatingSection, MarkupLevel.Row); repeatingSectionSdt.XmlMapping.SetMapping(xmlPart, "/books[1]/book", ""); table.AppendChild(repeatingSectionSdt); StructuredDocumentTag repeatingSectionItemSdt = new StructuredDocumentTag(doc, SdtType.RepeatingSectionItem, MarkupLevel.Row); repeatingSectionSdt.AppendChild(repeatingSectionItemSdt); Row row = new Row(doc); repeatingSectionItemSdt.AppendChild(row); StructuredDocumentTag titleSdt = new StructuredDocumentTag(doc, SdtType.PlainText, MarkupLevel.Cell); titleSdt.XmlMapping.SetMapping(xmlPart, "/books[1]/book[1]/title[1]", ""); row.AppendChild(titleSdt); StructuredDocumentTag authorSdt = new StructuredDocumentTag(doc, SdtType.PlainText, MarkupLevel.Cell); authorSdt.XmlMapping.SetMapping(xmlPart, "/books[1]/book[1]/author[1]", ""); row.AppendChild(authorSdt); doc.Save(dir + "Document.docx");