Advertisement
Guest User

convert

a guest
Jan 7th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. #!/bin/sh
  2. PAGES=58 # set to the number of pages in the PDF
  3. SOURCE=05.Kalt_erwischt_in_Hamburg.pdf # set to the file name of the PDF
  4. OUTPUT=book.txt # set to the final output file
  5. RESOLUTION=600 # set to the resolution the scanner used (the higher, the better)
  6.  
  7. touch $OUTPUT
  8.  
  9. for i in `seq 1 $PAGES`; do
  10.  
  11. convert -monochrome -density $RESOLUTION $SOURCE\[$(($i - 1 ))\] page$i.tif;
  12. tesseract page$i.tif -l deu >> $OUTPUT;
  13.  
  14. done
  15.  
  16.  
  17. errors in lines 6,8  -->  ./convert.sh: line 6: $'\r': command not found
  18. error in line 9 --> syntax error near  '$'do\r''
  19.          line 9: `for i in `seq 1 $PAGES`; do
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement