= doc.Getfirstitem("Body") ForAll o In rtitem.Embeddedobjects If o.Type = EMBED_ATTACHMENT Then filepath = dataDir & dlm & o.Source o.ExtractFile filepath ‘ここでOCR処理を行う Kill filepath End If End ForAll
スラッシュ Dim ss As New NotesSession Dim platform$, dlm$ platform = LCase( ss.platform ) If platform = "ios" Then dlm = "/" ElseIf platform = "windows/32" Then dlm = "¥" End If
コードしたものに置換してPOSTします { "requests": [ { "image": { "content": "EncodedText" }, "features": [ { "type": "DOCUMENT_TEXT_DETECTION" } ] } ] } Dim ss As New NotesSession Dim req As NotesHTTPRequest Dim nav As NotesJSONNavigator Set req = ss.Createhttprequest() json$ = |{“requests”: [{“image”:{“content”:”…”},…}]}| req.Timeoutsec = 60 req.Preferjsonnavigator = True req.Setheaderfield "Content-Type", "application/json" Set nav = req.Post( url, json )
"description": "OCR Text" } ] } ] } Dim elm As NotesJSONElement Dim obj As NotesJSONObject Dim arr As NotesJSONArray Set elm = nav.Getelementbyname( "responses" ) Set arr = elm.Value Set elm = arr.Getfirstelement() Set obj = elm.Value Set elm = obj.Getelementbyname( "textAnnotations" ) Set arr = elm.Value Set elm = arr.Getfirstelement() Set obj = elm.Value Set elm = obj.Getelementbyname( "description" ) MessageBox elm.Value,,"OCR Text" 探したい値が配列の何番目にある かわからない場合に有効です
to parse JSON content > 64k • ASHEB95LFR - Unable to parse JSON string: Missing a name for object member, offset 1 • DCONB8F6JV - bad character conversion happening in NotesHTTPRequest response • ASHEB95LFR - NotesJSONNavigator unable to navigate a string which contains new lines and carriage returns • DCONBB2KNR - NotesJSONNavigator experiencing severe issues when parsing packages with empty string values • JCORBB2KWU - Unable to Post > 64K String in NotesHTTPRequest • DCONBB44T4 - Creating a NotesJSONNavigator from nulled response causes crash Limitations of NotesHTTPRequest and NotesJSONNavigator with future considerations https://www.ibm.com/support/pages/limitations-noteshttprequest-and-notesjsonnavigator-future-considerations