1
<?xml version="1.0" encoding="utf-8"?>
4
This file allows you to use external programs to extract text from
5
more structured file formats. For example, you could use pdftotext to
6
extract data from PDF files. (Beagle includes a PDF filter, so this
7
isn't necessary, but you get the idea.)
9
There are some limitations to this system: the external programs must
10
take a filename on the command line and must output text to standard
11
out. You cannot extract any metadata using this system. Using our
12
PDF example, you could extract all of the text, but you couldn't
13
extract the author of the document as a special field. For that, you
14
will have to write a more traditional filter.
16
Now, an example entry:
19
<mimetype>text/plain</mimetype>
20
<extension>.txt</extension>
21
<command>cat</command>
22
<arguments>%s</arguments>
25
mimetype - The mime type handled by this filter. You may have 0 or
26
more of these for any filter.
28
extension - The file extension handled by this filter. You may have 0
29
or more of these for any filter.
31
command - The filename of the command to run. Do not put any command
32
line arguments in this. This item is required.
34
arguments - Any arguments to pass into the given command. The special
35
token "%s" means the filename to be passed in. This item is required.
37
Here are some sample filters from the Wiki, simply move them into the
38
'external-filters' tags to activate!
42
* Author: Stephan Hegel
43
* Description: untex to remove LaTeX commands from input
46
<mimetype>text/x-tex</mimetype>
47
<extension>.tex</extension>
48
<command>untex</command>
49
<arguments>-gascii %s</arguments>
55
* Description: dvi to text using the "-q" option of dvi2tty
56
* Dependencies: dvi2tty
58
<mimetype>application/x-dvi</mimetype>
59
<extension>.dvi</extension>
60
<command>dvi2tty</command>
61
<arguments>-q %s</arguments>
64
Simple Postscript filter
67
* Description: ps2ascii to extract text from postscript
68
* Dependencies: ps2ascii
70
<mimetype>application/postscript</mimetype>
71
<extension>.ps</extension>
72
<extension>.ai</extension>
73
<extension>.eps</extension>
74
<command>ps2ascii</command>
75
<arguments>%s</arguments>
80
* Description: djvutxt to extract text from Djvu files
81
* Dependencies: djvutxt
83
<mimetype>image/vnd.djvu</mimetype>
84
<extension>.djvu</extension>
85
<extension>.djv</extension>
86
<command>djvutxt</command>
87
<arguments>%s</arguments>