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 -cropbox
73 Use the crop box rather than the media box with -bbox and -bbox-
74 layout.
75
76 -enc encoding-name
77 Sets the encoding to use for text output. This defaults to
78 "UTF-8".
79
80 -listenc
81 Lists the available encodings
82
83 -eol unix | dos | mac
84 Sets the end-of-line convention to use for text output.
85
86 -nopgbrk
87 Don't insert page breaks (form feed characters) between pages.
88
89 -opw password
90 Specify the owner password for the PDF file. Providing this
91 will bypass all security restrictions.
92
93 -upw password
94 Specify the user password for the PDF file.
95
96 -q Don't print any messages or errors.
97
98 -v Print copyright and version information.
99
100 -h Print usage information. (-help and --help are equivalent.)
101
103 Some PDF files contain fonts whose encodings have been mangled beyond
104 recognition. There is no way (short of OCR) to extract text from these
105 files.
106
108 The Xpdf tools use the following exit codes:
109
110 0 No error.
111
112 1 Error opening a PDF file.
113
114 2 Error opening an output file.
115
116 3 Error related to PDF permissions.
117
118 99 Other error.
119
121 The pdftotext software and documentation are copyright 1996-2011 Glyph
122 & Cog, LLC.
123
125 pdfdetach(1), pdffonts(1), pdfimages(1), pdfinfo(1), pdftocairo(1),
126 pdftohtml(1), pdftoppm(1), pdftops(1), pdfseparate(1), pdfsig(1), pdfu‐
127 nite(1)
128
129
130
131 15 August 2011 pdftotext(1)