1pdftotext(1) General Commands Manual pdftotext(1)
2
3
4
6 pdftotext - Portable Document Format (PDF) to text converter (version
7 3.03)
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. If PDF-
18 file is ´-', it reads the PDF file from stdin.
19
21 -f number
22 Specifies the first page to convert.
23
24 -l number
25 Specifies the last page to convert.
26
27 -r number
28 Specifies the resolution, in DPI. The default is 72 DPI.
29
30 -x number
31 Specifies the x-coordinate of the crop area top left corner
32
33 -y number
34 Specifies the y-coordinate of the crop area top left corner
35
36 -W number
37 Specifies the width of crop area in pixels (default is 0)
38
39 -H number
40 Specifies the height of crop area in pixels (default is 0)
41
42 -layout
43 Maintain (as best as possible) the original physical layout of
44 the text. The default is to ´undo' physical layout (columns,
45 hyphenation, etc.) and output the text in reading order.
46
47 -fixed number
48 Assume fixed-pitch (or tabular) text, with the specified charac‐
49 ter width (in points). This forces physical layout mode.
50
51 -raw Keep the text in content stream order. This is a hack which of‐
52 ten "undoes" column formatting, etc. Use of raw mode is no
53 longer recommended.
54
55 -nodiag
56 Discard diagonal text (i.e., text that is not close to one of
57 the 0, 90, 180, or 270 degree axes). This is useful for skipping
58 watermarks drawn on body text.
59
60 -htmlmeta
61 Generate a simple HTML file, including the meta information.
62 This simply wraps the text in <pre> and </pre> and prepends the
63 meta headers.
64
65 -bbox Generate an XHTML file containing bounding box information for
66 each word in the file.
67
68 -bbox-layout
69 Generate an XHTML file containing bounding box information for
70 each block, line, and word in the file.
71
72 -tsv Generate a TSV file containing the bounding box information for
73 each block, line, and word in the file.
74
75 -cropbox
76 Use the crop box rather than the media box with -bbox and -bbox-
77 layout.
78
79 -colspacing number
80 Specifies how much spacing we allow after a word before consid‐
81 ering adjacent text to be a new column, measured as a fraction
82 of the font size. Current default is 0.7, old releases had a 0.3
83 default.
84
85 -enc encoding-name
86 Sets the encoding to use for text output. This defaults to
87 "UTF-8".
88
89 -listenc
90 Lists the available encodings
91
92 -eol unix | dos | mac
93 Sets the end-of-line convention to use for text output.
94
95 -nopgbrk
96 Don't insert page breaks (form feed characters) between pages.
97
98 -opw password
99 Specify the owner password for the PDF file. Providing this
100 will bypass all security restrictions.
101
102 -upw password
103 Specify the user password for the PDF file.
104
105 -q Don't print any messages or errors.
106
107 -v Print copyright and version information.
108
109 -h Print usage information. (-help and --help are equivalent.)
110
112 Some PDF files contain fonts whose encodings have been mangled beyond
113 recognition. There is no way (short of OCR) to extract text from these
114 files.
115
117 The Xpdf tools use the following exit codes:
118
119 0 No error.
120
121 1 Error opening a PDF file.
122
123 2 Error opening an output file.
124
125 3 Error related to PDF permissions.
126
127 99 Other error.
128
130 The pdftotext software and documentation are copyright 1996-2011 Glyph
131 & Cog, LLC.
132
134 pdfdetach(1), pdffonts(1), pdfimages(1), pdfinfo(1), pdftocairo(1),
135 pdftohtml(1), pdftoppm(1), pdftops(1), pdfseparate(1), pdfsig(1), pdfu‐
136 nite(1)
137
138
139
140 15 August 2011 pdftotext(1)