使用Aspose.Note for Java 17.11处理冲突页面

Aspose.Note for Java 17.11现已发布。此版本增强了处理Notebook文档中页面冲突的能力。它还改善了API的错误修复,进一步增加了API功能的稳定性。有关新增功能和修复功能的详细说明,请访问API文档中的发行说明部分

使用Aspose.Note for Java 17.11处理页面冲突

此版本的API提供了一个增强功能,可以将来自历史记录的页面版本标识为冲突页面。保存文件时默认跳过冲突页面。 使用API,如果使用isConflictPage方法将其标记为非冲突,则它将像往常一样保存在历史记录中,而不会被忽略,如以下代码示例所示。

// Load the document into Aspose.Note
LoadOptions options = new LoadOptions();
Document doc = new Document(dataDir + "Aspose.one", options);

DateFormat df = new SimpleDateFormat("dd.MM.yyyy HH.mm.ss");
		
PageHistory history = doc.getPageHistory(doc.getFirstChild());
for (int i = 0; i < history.size(); i++)
{
	Page historyPage = history.get_Item(i);
	System.out.format(" %d. Author: %s, %s",
                  i,
                  historyPage.getPageContentRevisionSummary().getAuthorMostRecent(),
                  df.format(historyPage.getPageContentRevisionSummary().getLastModifiedTime()));
	System.out.println(historyPage.isConflictPage() ? ", IsConflict: true" : "");
    // By default conflict pages are just skipped on saving.
    // If mark it as non-conflict then it will be saved as usual one in the history.
    if (historyPage.isConflictPage())
        historyPage.setConflictPage(false);
}

doc.save(dataDir + "ConflictPageManipulation_out.one", SaveFormat.One);

API产品资源

  • 文档?–请立即访问我们的文档部分以开始使用API
  • API参考指南?–给出关于API的所有命名空间,类和方法的详细信息
  • 技术支持论坛?–在Aspose.Note论坛发表您的问题,以获得我们的技术支持团队的帮助
  • GitHub存储库代码示例?– 从我们的GitHub存储库中下载试用API的现成示例