Skip to content

Instantly share code, notes, and snippets.

@Ad5001
Last active December 20, 2017 10:25
Show Gist options
  • Save Ad5001/36f178ecd4b27de7a209deef92c0e0b2 to your computer and use it in GitHub Desktop.
Save Ad5001/36f178ecd4b27de7a209deef92c0e0b2 to your computer and use it in GitHub Desktop.
Script to transcript an image to an ODT file for linux & macos. Dependencies: tesseract-ocr, docutils (https://sourceforge.net/projects/docutils/?source=typ_redirect)
#!/bin/sh
convert $1 /tmp/out.tif
tesseract -l ${1:fra} /tmp/out.tif /tmp/out > /tmp/img2odt.log || echo "Error! Image conversion failed. Check /tmp/img2odt for more infos"
rst2odt.py /tmp/out.txt "$(pwd)/out.odt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment