PDF OCR API via Windows CMD

Hello,
when we attempt to upload/parse a pdf file through POSTMAN, it works. When we do it through Windows Command line with same parameters - it doesn’t. CURL is installed and working. The pdf file is in the same directory as curl.exe file. The file itself is simple, one page, black text, white background.

The command looks like this:
curl -H “apikey:helloworld” --form “file=@ccc.pdf” --form “language=eng” --form “isOverlayRequired=true” https://api.ocr.space/Parse/Image

Result:
curl (26): Failed to open/read local data from file/application

Also the command (base64 string is shortened here on purpose):
curl -H “apikey:helloworld” --form “base64Image=data:application/pdf;base64,JVBERi0xLjIgDQol4u…T0YNCg==” --form “language=eng” --form “isOverlayRequired=false” https://api.ocr.space/parse/image

string taken from here - ocr.space/text/base64string_smallpdf.txt

Result:
Warning: skip unknown form field…

ends up with “Some internal processing error occured”.

Would appreciate some guidance. Thank you :slight_smile:

You forgot the POST: -X POST

Thanks for the input. Did the change. Getting the same result - curl (26): Failed to open/read local data from file/application.

Command looks like this now:
curl -X POST https://api.ocr.space/Parse/Image -H “apikey:helloworld” --form “file=@ccc.pdf” --form “language=eng” --form “isOverlayRequired=true”

Here is a batch file that works for me:

curl  -H "apikey:helloworld"  --form "file=@big.png" --form "language=eng" --form "isOverlayRequired=true" https://api.ocr.space/parse/image 
pause

Screencast: https://www.screencast.com/t/pr2DZsXXKU

Try putting the full path to your file: --form "file=@C:\Path\Path\File.pdf"

That’s the only difference I see between yours and the one that works fine on my end

Thank you guys for help. Greatly appreciate your responses.
Finally made it work. Looks like this:

command