Hi,
I got Pen to Print - Handwriting OCR API Documentation from Rapid API and it tested succssfully. But some coing need to be change when I want to use it on Node Red.
I use (javascript)fetch as my mode of coding.
const form = new FormData();
form.append("Session", "string");
form.append("srcImg", "photo_2021-09-16_18-49-42.jpg");
fetch("https://pen-to-print-handwriting-ocr.p.rapidapi.com/recognize/", {
"method": "POST",
"headers": {
"content-type": "multipart/form-data; boundary=---011000010111000001101001",
"x-rapidapi-host": "pen-to-print-handwriting-ocr.p.rapidapi.com",
"x-rapidapi-key": "eee39b0bfdmsh2a9df53d16d7303p156127jsne96465bf0c7d"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
The issue is :
- error shows "ReferenceError: FormData is not defined (line 1, col 14)" , maybe need some suggestion on how to take out the output (image) that I upload throught UI upload node.
I think something to do with line 1,2,3 and after that response how to respose to give output in text.
My nodes connection :
My UI OCR reader.
Picture will uplad and give out text .
These are link of my references :
-OCR reader API
Pen to Print - Handwriting OCR API Documentation (serendi) | RapidAPI