Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/montanaflynn/gocr
CLI for PDF OCR API written in Go
https://github.com/montanaflynn/gocr
cli convert docx latex markdown mathpix ocr pdf
Last synced: 28 days ago
JSON representation
CLI for PDF OCR API written in Go
- Host: GitHub
- URL: https://github.com/montanaflynn/gocr
- Owner: montanaflynn
- License: mit
- Created: 2021-03-18T06:37:40.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-19T01:46:15.000Z (almost 4 years ago)
- Last Synced: 2024-10-14T11:32:21.318Z (2 months ago)
- Topics: cli, convert, docx, latex, markdown, mathpix, ocr, pdf
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PDF OCR
Convert PDFs to Mathpix Markdown, Microsoft Word or LaTeX:
## Install
```
curl -sf https://gobinaries.com/montanaflynn/gocr/cmd/gocr | sh
```## Usage
Sign up for an OCR API key at https://accounts.mathpix.com then run `gocr`:
### Interactive
```
gocr
? What is your mathpix api key? ********************
? Which file should be used as an input? example.pdf
? Where would you like to save it? example.mmd
? Do you agree to the cost of $1.20 for 12 pages? Yes
✓ Saved example.mmd
```### Non-interactive
```
export MATHPIX_OCR_API_KEY=...
gocr --agree example.pdf example.docx
✓ Saved example.docx
```### CLI configuration, arguments and flags:
- You can set input and output paths as arguments `gocr input.pdf output.docx`
- You can set the API key with an environment variable `MATHPIX_OCR_API_KEY`
- You can set the API key with the flag `gocr --api-key ...`
- You can skip the cost agreement with the flag `gocr --agree`
- You can view all flags and arguments with `gocr --help`