-
Notifications
You must be signed in to change notification settings - Fork 2
/
read-it-tesseract.desktop
102 lines (100 loc) · 4.55 KB
/
read-it-tesseract.desktop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
[Desktop Entry]
Type=Service
Name=Extract Text (tesseract)
MimeType=image/*;
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
Icon=text-flow-into-frame
Actions=ReadIt;ReadIt-PDF;
#TryExec=tesseract
[Desktop Action ReadIt]
Name=Extract text
Name[de]=Text extrahieren
Name[fr]=Extraire du texte
Name[it]=Estrarre il testo
Name[ar]=استخراج النص
Name[is]=Draga út texta
Name[ch]=提取文本
Name[da]=Udtrække tekst
Name[et]=Udtrække tekst
Name[fi]=Poimia tekstiä
Name[ka]=Ტექსტის ამოღება
Name[el]=Εξαγωγή κειμένου
Name[he]=לחלץ טקסט
Name[id]=Ekstrak teks
Name[ga]=Sliocht téacs
Name[is]=Draga út texta
Name[jp]=テキストを抽出する
Name[ko]=텍스트 추출
Name[lv]=Izvilkt tekstu
Name[lt]=Ištraukite tekstą
Name[mi]=Tango kupu
Name[nl]=Tekst extraheren
Name[no]=Trekke ut tekst
Name[fa]=Trekke ut tekst
Name[pl]=Wyodrębnij tekst
Name[pt]=Extrair texto
Name[sv]=Extrahera text
Name[sk]=Extrahovať text
Name[es]=Extraer texto
Name[th]=แยกข้อความ
Name[cs]=Extrahovat text
Name[uk]=Витягти текст
# Icon=application-text # =
# Icon=artistictext-tool # a # no display
# Icon=edit-select-text # AI # displays arrow up left !?
# Icon=dialog-text-and-font # T # no display
# Icon=text-convert-to-regular # Tt
Icon=text-flow-into-frame
# this extremly simple approach tries to get the first langauge used.
# this basicly works e.g. for italian, german or english, but not for
# spanish (es!=spa) :(
# it also will brutaly overwrite existing files! :(
# HINT: text="${image%.*}"; is a modification that removes the filename
# extension before tesseract appends .txt to the new text file by itself.
Exec=bash -c 'format="txt"; tryexec="$(type -p tesseract)"; [[ -n "$tryexec" ]] || kdialog --detailederror "tesseract not found, must quit" "tesseract(1) could not be executed from \$PATH. \n\nLikely it is not installed at all. \n\nPlease try to install with your systems package manger and try again."; [[ -n "$tryexec" ]] || exit 1; lang_option=""; lang="$(tesseract --list-langs | grep ${LANG:0:2})"; [[ -n "$lang" ]] && lang_option="-l $lang"; image="%u"; text="${image}"; tesseract "${image}" "${text}" ${lang_option} "$format" && kdialog --title "Read-It, file created: " --passivepopup "${text}.$format" 5'
[Desktop Action ReadIt-PDF]
Name=Extract text (PDF)
Name[de]=Text extrahieren (PDF)
Name[fr]=Extraire du texte (PDF)
Name[it]=Estrarre il testo (PDF)
Name[ar]=(PDF) استخراج النص
Name[is]=Draga út texta (PDF)
Name[ch]=提取文本 (PDF)
Name[da]=Udtrække tekst (PDF)
Name[et]=Udtrække tekst (PDF)
Name[fi]=Poimia tekstiä (PDF)
Name[ka]=Ტექსტის ამოღება (PDF)
Name[el]=Εξαγωγή κειμένου (PDF)
Name[he]=(PDF) לחלץ טקסט
Name[id]=Ekstrak teks (PDF)
Name[ga]=Sliocht téacs (PDF)
Name[is]=Draga út texta (PDF)
Name[jp]=テキストを抽出する (PDF)
Name[ko]=텍스트 추출 (PDF)
Name[lv]=Izvilkt tekstu (PDF)
Name[lt]=Ištraukite tekstą (PDF)
Name[mi]=Tango kupu (PDF)
Name[nl]=Tekst extraheren (PDF)
Name[no]=Trekke ut tekst (PDF)
Name[fa]=Trekke ut tekst (PDF)
Name[pl]=Wyodrębnij tekst (PDF)
Name[pt]=Extrair texto (PDF)
Name[sv]=Extrahera text (PDF)
Name[sk]=Extrahovať text (PDF)
Name[es]=Extraer texto (PDF)
Name[th]=แยกข้อความ (PDF)
Name[cs]=Extrahovat text (PDF)
Name[uk]=Витягти текст (PDF)
# Icon=application-text # =
# Icon=artistictext-tool # a # no display
# Icon=edit-select-text # AI # displays arrow up left !?
# Icon=dialog-text-and-font # T # no display
# Icon=text-convert-to-regular # Tt
Icon=text-flow-into-frame
# this extremly simple approach tries to get the first langauge used.
# this basicly works e.g. for italian, german or english, but not for
# spanish (es!=spa) :(
# it also will brutaly overwrite existing files! :(
# HINT: text="${image%.*}"; is a modification that removes the filename
# extension before tesseract appends .txt to the new text file by itself.
Exec=bash -c 'format="pdf"; tryexec="$(type -p tesseract)"; [[ -n "$tryexec" ]] || kdialog --detailederror "tesseract not found, must quit" "tesseract(1) could not be executed from \$PATH. \n\nLikely it is not installed at all. \n\nPlease try to install with your systems package manger and try again."; [[ -n "$tryexec" ]] || exit 1; lang_option=""; lang="$(tesseract --list-langs | grep ${LANG:0:2})"; [[ -n "$lang" ]] && lang_option="-l $lang"; image="%u"; text="${image}"; tesseract "${image}" "${text}" ${lang_option} "$format" && kdialog --title "Read-It, file created: " --passivepopup "${text}.$format" 5'