1pdftotext(1) General Commands Manual pdftotext(1)
2
3
4
6 pdftotext - Portable Document Format (PDF) to text converter (version
7 3.00)
8
10 pdftotext [options] [PDF-file [text-file]]
11
13 Pdftotext converts Portable Document Format (PDF) files to plain text.
14
15 Pdftotext reads the PDF file, PDF-file, and writes a text file, text-
16 file. If text-file is not specified, pdftotext converts file.pdf to
17 file.txt. If text-file is ´-', the text is sent to stdout.
18
20 Pdftotext reads a configuration file at startup. It first tries to
21 find the user's private config file, ~/.xpdfrc. If that doesn't exist,
22 it looks for a system-wide config file, /etc/xpdf/xpdfrc. See the
23 xpdfrc(5) man page for details.
24
26 Many of the following options can be set with configuration file com‐
27 mands. These are listed in square brackets with the description of the
28 corresponding command line option.
29
30 -f number
31 Specifies the first page to convert.
32
33 -l number
34 Specifies the last page to convert.
35
36 -layout
37 Maintain (as best as possible) the original physical layout of
38 the text. The default is to ´undo' physical layout (columns,
39 hyphenation, etc.) and output the text in reading order.
40
41 -raw Keep the text in content stream order. This is a hack which
42 often "undoes" column formatting, etc. Use of raw mode is no
43 longer recommended.
44
45 -htmlmeta
46 Generate a simple HTML file, including the meta information.
47 This simply wraps the text in <pre> and </pre> and prepends the
48 meta headers.
49
50 -enc encoding-name
51 Sets the encoding to use for text output. The encoding-name
52 must be defined with the unicodeMap command (see xpdfrc(5)).
53 The encoding name is case-sensitive. This defaults to "Latin1"
54 (which is a built-in encoding). [config file: textEncoding]
55
56 -eol unix | dos | mac
57 Sets the end-of-line convention to use for text output. [config
58 file: textEOL]
59
60 -nopgbrk
61 Don't insert page breaks (form feed characters) between pages.
62 [config file: textPageBreaks]
63
64 -opw password
65 Specify the owner password for the PDF file. Providing this
66 will bypass all security restrictions.
67
68 -upw password
69 Specify the user password for the PDF file.
70
71 -q Don't print any messages or errors. [config file: errQuiet]
72
73 -cfg config-file
74 Read config-file in place of ~/.xpdfrc or the system-wide config
75 file.
76
77 -v Print copyright and version information.
78
79 -h Print usage information. (-help and --help are equivalent.)
80
82 Some PDF files contain fonts whose encodings have been mangled beyond
83 recognition. There is no way (short of OCR) to extract text from these
84 files.
85
87 The Xpdf tools use the following exit codes:
88
89 0 No error.
90
91 1 Error opening a PDF file.
92
93 2 Error opening an output file.
94
95 3 Error related to PDF permissions.
96
97 99 Other error.
98
100 The pdftotext software and documentation are copyright 1996-2004 Glyph
101 & Cog, LLC.
102
104 xpdf(1), pdftops(1), pdfinfo(1), pdffonts(1), pdftoppm(1), pdfim‐
105 ages(1), xpdfrc(5)
106 http://www.foolabs.com/xpdf/
107
108
109
110 22 January 2004 pdftotext(1)