#!/bin/bash #Translation export TEXTDOMAINDIR="/usr/share/locale" export TEXTDOMAIN=bigocrpdf # Don't group windows xprop -id "$(xprop -root '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)" -f WM_CLASS 8s -set WM_CLASS "$$" # Import BigControlCenter base modules / Importa os módulos básicos do BigControlCenter # That's include jquery and materialize / Isso inclui o jquery e o materialize # http://materializecss.com/ . /usr/share/bigbashview/bcc/shell/base.sh OIFS=$IFS IFS=$'\n' FILE="$(cat ~/.config/bigocrpdf/selected-file)" #Detect number of pages PAGES=0 for i in $FILE; do PAGES=$[ $PAGES + $(pdfinfo "$i" | grep "Pages:" | cut -f2 -d:) ] done FOLDER="$(dirname "$(head -n1 ~/.config/bigocrpdf/selected-file)")" FILENAME="$(basename "$FILE" | sed 's|\.pdf$||gI;s|\.jpg$||gI;s|\.jpeg$||gI;s|\.png$||gI;s| -ocr.pdf|-ocr.pdf|g')" NORMAL=$"Normal" ECONOMIC=$"Econômico" ECONOMICPLUS=$"Mais econômico" ALIGN=$"Alinhar" ROTATE=$"Auto rotacionar" ALIGNROTATE=$"Alinhar e auto rotacionar" NONE=$"Não alterar" SPANISH=$"Espanhol" ENGLISH=$"Inglês" PORTUGUESE=$"Português" Destiny=$"Destino:" Apply=$"Aplicar" if [ ! -w "$FOLDER" ] then FOLDER="$HOME" fi if [[ -e "${FOLDER}/${FILENAME}-ocr.pdf" || -L "${FOLDER}/${FILENAME}-ocr.pdf" ]] ; then i=2 while [[ -e "${FOLDER}/${FILENAME}-ocr${i}.pdf" || -L "${FOLDER}/${FILENAME}-ocr${i}.pdf" ]] ; do let i++ done SAVEFILE="${FOLDER}/${FILENAME}-ocr${i}.pdf" else SAVEFILE="${FOLDER}/${FILENAME}-ocr.pdf" fi cat << EOF
EOF cat << EOF
EOF # Get body tag with color light or not /usr/share/bigbashview/bcc/shell/getbgcolor.sh cat << EOF
EOF cat << EOF
EOF echo '

### ' echo $"Adicionar OCR no PDF digitalizado permitindo seleção de textos e busca:" echo '

' cat << EOF
EOF cat << EOF

EOF echo '
- ' $"Quantidade de arquivos:" cat << EOF $(cat ~/.config/bigocrpdf/selected-file | wc -l)
EOF echo '
- ' $"Páginas:" cat << EOF $PAGES
EOF echo '
- ' $"Idioma do PDF:" cat << EOF EOF echo '
  ' echo '
- ' echo $"Qualidade do PDF:" echo '' echo "
  $TOOLTIP_QUALITY
  \">" # Verify previous selected LANG PDF_QUALITY="$(cat ~/.config/bigocrpdf/quality)" if [ "$PDF_QUALITY" = "" ] || [ "$PDF_QUALITY" = "1" ];then NORMAL_CHECKED="selected" fi if [ "$PDF_QUALITY" = "2" ];then ECONOMIC_CHECKED="selected" fi if [ "$PDF_QUALITY" = "3" ];then ECONOMIC_PLUS_CHECKED="selected" fi echo "
  ' echo '
- ' echo $"Alinhamento:" echo '' echo "
  $TOOLTIP_QUALITY
  \">" # Verify previous selected LANG PDF_ALIGN="$(cat ~/.config/bigocrpdf/align)" if [ "$PDF_ALIGN" = "" ];then CHECKED_NONE="selected" fi if [ "$PDF_ALIGN" = "-d" ];then CHECKED_ALIGN="selected" fi if [ "$PDF_ALIGN" = "-r" ];then CHECKED_ROTATE="selected" fi if [ "$PDF_ALIGN" = "-dr" ];then CHECKED_ALIGNROTATE="selected" fi echo "
  ' cat << EOF
- $Destiny EOF #echo "$SAVEFILE" "

" #echo "
" #echo "" #Support multi pdf if [ "$(cat ~/.config/bigocrpdf/selected-file | wc -l)" -gt "1" ]; then echo "" else echo "" fi #echo "" cat << EOF
EOF cat << EOF
EOF