新里程碑!Java平臺Word處理控件Aspose.Words v19.11支持Harfbuzz Shaper插件!

很高興與你們分享Java平臺的Aspose.Words最新版v19.11實現了另外一個里程碑,該版本在基於Unix的操做系統上支持Harfbuzz Shaper插件,並使開發人員可以使用Web擴展,自定義水平格式規則形狀等。接下來,咱們一塊兒來聊聊新版本的新功能。性能

Aspose.Words for Java(點擊下載是功能豐富的Word處理API,容許開發人員在不使用Microsoft Word的狀況下嵌入在本身的Java應用程序中生成,修改,轉換,呈現和打印文檔的功能。ui

主要特色

  • 基於Unix的操做系統支持Harfbuzz Shaper插件。
  • 提供了與Web擴展一塊兒使用的功能,新類容許自定義元素和屬性,以擴展Office加載項表示形式的XML詞彙表。
  • 添加了自定義水平尺形狀的格式的功能。
  • 設置了「使用打印機指標」選項時,改進了字符間距計算。
  • 宏支持獲得改善。

Web擴展元素的支持

Aspose.Words API提供了WebExtensions命名空間,該命名空間提供了各類類來定製元素和屬性,這些元素和屬性擴展了XML詞彙表以表示Office加載項。如今,可使用Aspose.Words for Java 與Office加載項和Web Extensions中的任務窗格一塊兒使用。爲此,新版本提供了新的TaskPane類,TaskPaneCollection類,TaskPaneDockState枚舉,Document.WebExtensionTaskPanes屬性等。spa

如下代碼示例演示如何建立具備基本屬性的任務窗格並將其添加到Web擴展任務窗格。操作系統

Document doc = new Document();

TaskPane taskPane = new TaskPane();
doc.getWebExtensionTaskPanes().add(taskPane);

taskPane.setDockState(TaskPaneDockState.RIGHT);
taskPane.isVisible(true);
taskPane.setWidth(300);

taskPane.getWebExtension().getReference().setId("wa102923726");
taskPane.getWebExtension().getReference().setVersion("1.0.0.0");
taskPane.getWebExtension().getReference().setStoreType(WebExtensionStoreType.OMEX);
taskPane.getWebExtension().getReference().setStore("th-TH");
taskPane.getWebExtension().getProperties().add(new WebExtensionProperty("mailchimpCampaign", "mailchimpCampaign"));
taskPane.getWebExtension().getBindings().add(new WebExtensionBinding("UnnamedBinding_0_1506535429545", WebExtensionBindingType.TEXT, "194740422"));
        
doc.save(dataDir + "output.docx", SaveFormat.DOCX);

自定義水平規則形狀的格式

Aspose.Words for Java API如今提供Shape.HorizontalRuleFormat屬性,以訪問水平規則形狀的屬性。該HorizontalRuleFormat類暴露,如基本的性能高度,顏色,NoShade等下面的代碼示例演示瞭如何設置HorizontalRuleFormat格式化水平線。插件

DocumentBuilder builder = new DocumentBuilder();

Shape shape = builder.insertHorizontalRule();
HorizontalRuleFormat horizontalRuleFormat = shape.getHorizontalRuleFormat();

horizontalRuleFormat.setAlignment(HorizontalRuleAlignment.CENTER);
horizontalRuleFormat.setWidthPercent(70);
horizontalRuleFormat.setHeight(3);
horizontalRuleFormat.setColor(Color.BLUE);
horizontalRuleFormat.setNoShade(true);

builder.getDocument().save("HorizontalRuleFormat.docx");
相關文章
相關標籤/搜索