macOS Catalina (10.15) adjusted the privacy & permissions. In this case, need to enable “Screen Recording” permission for iText to let it capture screen to recognize the text in it.
Specifically, when using iText to capture screen for the first time in macOS Catalina, the following dialog will pop up:
At this point, you can click “Open System Preferences”. If you ever clicked “Deny”, you can manually open the “System Preferences” app, select “Security & Privacy”, and then in the “Privacy” column, select “Screen Recording” on the left.
In this page, enable iText. After restart iText, it will work correctly.