-ofile
Specifies the output file name. The default is to print the extracted contents to standard output in
text format.
-ppageno[,pageno,...]
Specifies the comma-separated list of the page numbers to be extracted. Page numbers start at one. By
default, it extracts text from all the pages.
-ccodec
Specifies the output codec.
-ttype
Specifies the output format. The following formats are currently supported:
text
Text format. This is the default.
html
HTML format. It is not recommended.
xml
XML format. It provides the most information.
tag
“Tagged PDF” format. A tagged PDF has its own contents annotated with HTML-like tags. pdf2txt
tries to extract its content streams rather than inferring its text locations. Tags used here are
defined in the PDFReference,SixthEdition[1] (§10.7 “Tagged PDF”).
-Dwriting-mode
Specifies the writing mode of text outputs:
lr-tb
Left-to-right, top-to-bottom.
tb-rl
Top-to-bottom, right-to-left.
auto
Determine writing mode automatically
-Mchar-margin, -Lline-margin, -Wword-margin
These are the parameters used for layout analysis. In an actual PDF file, text portions might be
split into several chunks in the middle of its running, depending on the authoring software.
Therefore, text extraction needs to splice text chunks. In the figure below, two text chunks whose
distance is closer than the char-margin is considered continuous and get grouped into one. Also, two
lines whose distance is closer than the line-margin is grouped as a text box, which is a rectangular
area that contains a “cluster” of text portions. Furthermore, it may be required to insert blank
characters (spaces) as necessary if the distance between two words is greater than the word-margin,
as a blank between words might not be represented as a space, but indicated by the positioning of
each word.
Each value is specified not as an actual length, but as a proportion of the length to the size of
each character in question. The default values are char-margin = 1.0, line-margin = 0.3, and W=0.2,
respectively.
-n
Suppress layout analysis.
-A
Force layout analysis for all the text strings, including text contained in figures.
-V
Enable detection of vertical writing.
-sscale
Specifies the output scale. This option can be used in HTML format only.
-mn
Specifies the maximum number of pages to extract. By default, all the pages in a document are
extracted.
-Ppassword
Provides the user password to access PDF contents.
-d
Increase the debug level.