Unable to delete file after Google OCR

Hello,

I would like to read information out from PDF files and after the reading I would like to delete them with the “Delete” activity.

The Google OCR works fine, but 2 out of 10 the workflow gives back the following error message during deletion:

Source: Delete
Message: The process cannot access the file ‘C:\1.pdf’ because it is being used by another process.
Exception Type: IOException

Is it possible to somehow force the deletion of the file or how can I stop using the file with the Google OCR activity?

Thank you

here it is trying to delete file before the completion of Google OCR activity execution is completed

1.try to have delay once after you finish reading the data(Not recommended).
2. if there are any activity inbetween google OCR and Delete file with “WaitforReady” property change that to complete from interactive(default).

1 Like

I use only log message between Google OCR and File Deletion.
Could you please recommend me an activity that has an WaitForReady property and could be used in this case? (like get cursor position or something like that with no huge delay impact on the process flow)
Thank you.

Its a workaround not sure you would help you. Once you read the PDF file then use a Kill process activity just before the Delete file and kill the process which is using PDF, this will make sure that file is not in use anywhere in the system.