Powershell OCR example

Tech support wrote to me that I should write my question here in the thread:

for now I want to try the free API for my purposes. Can you please share an example of a powershell script where I can insert a JPEG or PNG image from the local computer?

I only want to test it

Thank you

Hello, thanks for testing the free OCR API :slight_smile:

=> Here is a link to the Powershell OCR example.

Thanks, but none of the links helped me.

-The first link downloads the pdf file from the url
-There is no working solution for me in the second link

Can you please write me a few lines of code where I put my API and file path and the OCR will work?

Thank you

You need PowerShell > 7.x to use the Invoke-RestMethod listed or you’ll have to use cURL for Windows PowerShell.

Here is the link to the cURL Powershell OCR.space sample code

The script in your link again uses a url and not a file on the local computer

Just replace the cURL code in line 12 with the code from here:

(b) Upload image/PDF to be OCR’ed from your server/PC