source: main/trunk/greenstone2/bin/linux/xpdf-tools/doc/pdftotext.1@ 32205

Last change on this file since 32205 was 32205, checked in by ak19, 6 years ago

First set of commits to do with implementing the new 'paged_html' output option of PDFPlugin that uses using xpdftools' new pdftohtml. So far tested only on Linux (64 bit), but things work there so I'm optimistically committing the changes since they work. 2. Committing the pre-built Linux binaries of XPDFtools for both 32 and 64 bit built by the XPDF group. 2. To use the correct bitness variant of xpdftools, setup.bash now exports the BITNESS env var, consulted by gsConvert.pl. 3. All the perl code changes to do with using xpdf tools' pdftohtml to generate paged_html and feed it in the desired form into GS(3): gsConvert.pl, PDFPlugin.pm and its parent ConvertBinaryPFile.pm have been modified to make it all work. xpdftools' pdftohtml generates a folder containing an html file and a screenshot for each page in a PDF (as well as an index.html linking to each page's html). However, we want a single html file that contains each individual 'page' html's content in a div, and need to do some further HTML style, attribute and structure modifications to massage the xpdftool output to what we want for GS. In order to parse and manipulate the HTML 'DOM' to do this, we're using the Mojo::DOM package that Dr Bainbridge found and which he's compiled up. Mojo::DOM is therefore also committed in this revision. Some further changes and some display fixes are required, but need to check with the others about that.

File size: 5.1 KB
Line 
1.\" Copyright 1997-2017 Glyph & Cog, LLC
2.TH pdftotext 1 "10 Aug 2017"
3.SH NAME
4pdftotext \- Portable Document Format (PDF) to text converter
5(version 4.00)
6.SH SYNOPSIS
7.B pdftotext
8[options]
9.RI [ PDF-file
10.RI [ text-file ]]
11.SH DESCRIPTION
12.B Pdftotext
13converts Portable Document Format (PDF) files to plain text.
14.PP
15Pdftotext reads the PDF file,
16.IR PDF-file ,
17and writes a text file,
18.IR text-file .
19If
20.I text-file
21is not specified, pdftotext converts
22.I file.pdf
23to
24.IR file.txt .
25If
26.I text-file
27is \'-', the text is sent to stdout.
28.SH CONFIGURATION FILE
29Pdftotext reads a configuration file at startup. It first tries to
30find the user's private config file, ~/.xpdfrc. If that doesn't
31exist, it looks for a system-wide config file, typically
32/usr/local/etc/xpdfrc (but this location can be changed when pdftotext
33is built). See the
34.BR xpdfrc (5)
35man page for details.
36.SH OPTIONS
37Many of the following options can be set with configuration file
38commands. These are listed in square brackets with the description of
39the corresponding command line option.
40.TP
41.BI \-f " number"
42Specifies the first page to convert.
43.TP
44.BI \-l " number"
45Specifies the last page to convert.
46.TP
47.B \-layout
48Maintain (as best as possible) the original physical layout of the
49text. The default is to \'undo' physical layout (columns,
50hyphenation, etc.) and output the text in reading order. If the
51.B \-fixed
52option is given, character spacing within each line will be determined
53by the specified character pitch.
54.TP
55.B \-simple
56Similar to
57.BR \-layout ,
58but optimized for simple one-column pages. This mode will do a better
59job of maintaining horizontal spacing, but it will only work properly
60with a single column of text.
61.TP
62.B \-table
63Table mode is similar to physical layout mode, but optimized for
64tabular data, with the goal of keeping rows and columns aligned (at
65the expense of inserting extra whitespace). If the
66.B \-fixed
67option is given, character spacing within each line will be determined
68by the specified character pitch.
69.TP
70.B \-lineprinter
71Line printer mode uses a strict fixed-character-pitch and -height
72layout. That is, the page is broken into a grid, and characters are
73placed into that grid. If the grid spacing is too small for the
74actual characters, the result is extra whitespace. If the grid
75spacing is too large, the result is missing whitespace. The grid
76spacing can be specified using the
77.B \-fixed
78and
79.B \-linespacing
80options.
81If one or both are not given on the command line, pdftotext will
82attempt to compute appropriate value(s).
83.TP
84.B \-raw
85Keep the text in content stream order. Depending on how the PDF file
86was generated, this may or may not be useful.
87.TP
88.BI \-fixed " number"
89Specify the character pitch (character width), in points, for physical
90layout, table, or line printer mode. This is ignored in all other
91modes.
92.TP
93.BI \-linespacing " number"
94Specify the line spacing, in points, for line printer mode. This is
95ignored in all other modes.
96.TP
97.B \-clip
98Text which is hidden because of clipping is removed before doing
99layout, and then added back in. This can be helpful for tables where
100clipped (invisible) text would overlap the next column.
101.TP
102.B \-nodiag
103Diagonal text, i.e., text that is not close to one of the 0, 90, 180,
104or 270 degree axes, is discarded. This is useful to skip watermarks
105drawn on top of body text, etc.
106.TP
107.BI \-enc " encoding-name"
108Sets the encoding to use for text output. The
109.I encoding\-name
110must be defined with the unicodeMap command (see
111.BR xpdfrc (5)).
112The encoding name is case-sensitive. This defaults to "Latin1" (which
113is a built-in encoding).
114.RB "[config file: " textEncoding ]
115.TP
116.BI \-eol " unix | dos | mac"
117Sets the end-of-line convention to use for text output.
118.RB "[config file: " textEOL ]
119.TP
120.B \-nopgbrk
121Don't insert page breaks (form feed characters) between pages.
122.RB "[config file: " textPageBreaks ]
123.TP
124.B \-bom
125Insert a Unicode byte order marker (BOM) at the start of the text
126output.
127.TP
128.BI \-opw " password"
129Specify the owner password for the PDF file. Providing this will
130bypass all security restrictions.
131.TP
132.BI \-upw " password"
133Specify the user password for the PDF file.
134.TP
135.B \-q
136Don't print any messages or errors.
137.RB "[config file: " errQuiet ]
138.TP
139.BI \-cfg " config-file"
140Read
141.I config-file
142in place of ~/.xpdfrc or the system-wide config file.
143.TP
144.B \-v
145Print copyright and version information.
146.TP
147.B \-h
148Print usage information.
149.RB ( \-help
150and
151.B \-\-help
152are equivalent.)
153.SH BUGS
154Some PDF files contain fonts whose encodings have been mangled beyond
155recognition. There is no way (short of OCR) to extract text from
156these files.
157.SH EXIT CODES
158The Xpdf tools use the following exit codes:
159.TP
1600
161No error.
162.TP
1631
164Error opening a PDF file.
165.TP
1662
167Error opening an output file.
168.TP
1693
170Error related to PDF permissions.
171.TP
17299
173Other error.
174.SH AUTHOR
175The pdftotext software and documentation are copyright 1996-2017 Glyph
176& Cog, LLC.
177.SH "SEE ALSO"
178.BR xpdf (1),
179.BR pdftops (1),
180.BR pdftohtml (1),
181.BR pdfinfo (1),
182.BR pdffonts (1),
183.BR pdfdetach (1),
184.BR pdftoppm (1),
185.BR pdftopng (1),
186.BR pdfimages (1),
187.BR xpdfrc (5)
188.br
189.B http://www.xpdfreader.com/
Note: See TracBrowser for help on using the repository browser.