We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could you please provide the working example in node that will help me to upload the image .
I have tried with below code , but it is not working.
var bodyData = "-----BOUNDARY Content-Type: application/json {'engine':'tesseract'} -----BOUNDARY -----BOUNDARY Content-Type: image/png filename='attachment.txt'. "+fs.createReadStream("E:\OCR\ocr_test.png")+" -----BOUNDARY";
return new Promise(function (resolve, reject) { request({ method: 'POST', url: 'https://private-anon-63a2831b1f-openocr.apiary-mock.com/ocr-file-upload', headers: { 'Content-Type': 'multipart/related; boundary=---BOUNDARY' }, body : bodyData }, function(error, response, body){ console.log('Status:', response.statusCode); console.log('Headers:', JSON.stringify(response.headers)); console.log('Response:', body); if(error) reject(error) else resolve(body) }) });
The text was updated successfully, but these errors were encountered:
I use the following code to call openocr API
const metadata = { "engine": "tesseract", "engine_args": { "config_vars": {}, "psm": "11", "lang": "ind+eng", "oem": "1", }, "preprocessors": ["stroke-width-transform"] }; return rp({ method: 'POST', uri: 'http://your-hostname:9292/ocr-file-upload', multipart: [ { 'Content-Type': 'application/json', body: JSON.stringify(metadata) }, { 'Content-Type': 'image/png', 'Content-Disposition' : 'attachment; filename="test.png"', body: fs.createReadStream(processedFilename) } ], timeout: 120000 })
Sorry, something went wrong.
No branches or pull requests
Could you please provide the working example in node that will help me to upload the image .
I have tried with below code , but it is not working.
var bodyData = "-----BOUNDARY
Content-Type: application/json
{'engine':'tesseract'}
-----BOUNDARY
-----BOUNDARY
Content-Type: image/png
filename='attachment.txt'.
"+fs.createReadStream("E:\OCR\ocr_test.png")+"
-----BOUNDARY";
The text was updated successfully, but these errors were encountered: