【发布时间】:2017-07-20 00:37:42
【问题描述】:
OneNote 中有一个用于获取墨迹对象的 API。根据示例/documentation,您可以运行获取 InkStroke 对象的代码。我的理解是,Highlighter 笔画是 OneNote 对象模型中的 FloatingInk。是否可以获得有关中风本身的信息?比如:
if(inkObject.getType() == "Highlighter") {
var width = inkObject.getStroke().width;
var height = inkObject.getStroke().height;
}
文档在下面显示了一个示例,但它似乎只使“id”属性可用。
OneNote.run(function(context) {
// Gets the active page.
var page = context.application.getActivePage();
var contents = page.contents;
// Load page contents and their types.
page.load('contents/type');
return context.sync()
.then(function(){
// Load every ink content.
$.each(contents.items, function(i, content) {
if (content.type == "Ink"){
content.load('ink/id');
}
})
return context.sync();
})
.then(function(){
// Log ID of every ink content.
$.each(contents.items, function(i, content) {
if (content.type == "Ink"){
console.log(content.ink.id);
}
})
});
})
.catch(function(error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
【问题讨论】:
标签: office-addins onenote onenote-api