Download this file

QpdfviewHelperScript.txt    62 lines (42 with data), 1.4 kB

 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
== Starting native applications ==
Another example of using an intermediary script for an application with a
command line syntax which can't be directly defined in mimeview.
We use a script to preprocess and adapt the options before calling the
actual command.
Details about configuring how the native application or script are called
are given with the
link:http://www.recoll.org/usermanual/usermanual.html#RCL.INSTALL.CONFIG.MIMEVIEW[description
of the mimeview configuration file].
*qpdfview* (link:http://launchpad.net/qpdfview[web site]) is a very
lightweight tabbed PDF viewer with great search performance and result
highlighting.
It does support parsing the search term and page number from the command
line with the following syntax:
----
qpdfview --unique "%f"#%p --search "%s"
----
However, qpdfview will not launch if either %p or %s are empty in the
command above. To accommodate for that, Recoll user Florian has written a
small wrapper shell script:
----
#!/bin/bash
qpdfviewpath=qpdfview
if [ -z $2 ]
then
page=""
else
page="#"$2""
fi
if [ -z $3 ]
then
search=""
else
search="--search "$3""
fi
$qpdfviewpath --unique "$1"$page $search >&0 2>&0 &
----
The corresponding handler line for Recoll would be (depending on how you
name the script and where you store it):
----
qpdfviewwrapper %f %p %s
----