Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.57 KB

README.md

File metadata and controls

42 lines (30 loc) · 1.57 KB

Invoke Cape's Confidential OCR Service from SDKs

This folder shows you how you can run the Cape's confidential optical character recognition service from the SDKs: cape-js and pycape.

Before invoking the OCR service from one of the SDKs, you must sign up with Cape and generate a personal access token.

For this example, we will run the OCR on the PDF claude_shannon.pdf.

From cape-js

Before invoking the OCR, set the environment variable CAPE_AUTH_TOKEN to your personal access token.

export CAPE_AUTH_TOKEN="your cape auth token"

To run the OCR from cape-js on the PDF, run:

node run_ocr.mjs

To encrypt the PDF with cape.encrypt, then invoke the OCR on the encrypted PDF, run:

node encrypt_run_ocr.mjs

From pycape

Before invoking the OCR, set the environment variable CAPE_AUTH_TOKEN to your personal access token.

export CAPE_AUTH_TOKEN="your cape auth token"

To run the OCR from pycape on the PDF, run:

python run_ocr.py

To encrypt the PDF with cape.encrypt, then invoke the OCR on the encrypted PDF, run:

python encrypt_run_ocr.py