Is this possible? OCR via codeproject AI

Can I use this Java script in a node red function? I am not familiar with java programing and it shows errors I don’t know how to fix. Or is there any other method somebody can think of to get this to work. API node?

I have a static jpg i would like to use instead of the file picker the script references.