2017-05-05 48 views
0

有一个用于在OneNote中获取墨迹笔划对象的API。根据示例/ documentation,您可以运行获取InkStroke对象的代码。我的理解是,荧光笔笔画是OneNote对象模型中的FloatingInk。是否有可能获得关于中风本身的信息?例如:OneNote InkStroke/FloatingInk API

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)); 
    } 
}); 

回答

1

编辑:虽然不理想,你可以得到RestApiId然后进行API调用来检索文件的InkML,其中将包含此信息。

https://blogs.msdn.microsoft.com/onenotedev/2017/07/07/onenote-ink-beta-apis/


不幸的是,没有得到墨水笔划的坐标从OneNote信息加载项的方式。我鼓励你提交一份uservoice项目并把它链接到这里。

https://onenote.uservoice.com/forums/245490-onenote-developer-apis/

+1

新增的UserVoice –

+0

请求你将如何从加载项获得RestApiId? –

+0

Here:https://stackoverflow.com/questions/44753454/getrestapiid-function-in-objects-from-office-js-for-onenote –