add -n option to pdf2txt.py
git-svn-id: https://pdfminerr.googlecode.com/svn/trunk/pdfminer@157 1aa58f4a-7d42-0410-adbc-911cccaed67cpull/1/head
parent
faa775897c
commit
61d4872c3a
|
@ -19,7 +19,7 @@ Python PDF parser and analyzer
|
|||
|
||||
<div align=right class=lastmod>
|
||||
<!-- hhmts start -->
|
||||
Last Modified: Thu Nov 5 22:23:07 JST 2009
|
||||
Last Modified: Sat Nov 7 18:11:40 JST 2009
|
||||
<!-- hhmts end -->
|
||||
</div>
|
||||
|
||||
|
@ -259,6 +259,9 @@ are M = 1.0, L = 0.3, and W = 0.2, respectively.
|
|||
<td style="border-top:1px blue solid" align=right>↑</td>
|
||||
</tr></table>
|
||||
<p>
|
||||
<dt> <code>-n</code>
|
||||
<dd> Suppress layout analysis.
|
||||
<p>
|
||||
<dt> <code>-s <em>scale</em></code>
|
||||
<dd> Specifies the output scale. Can be used in HTML format only.
|
||||
<p>
|
||||
|
|
|
@ -12,11 +12,11 @@ def main(argv):
|
|||
import getopt
|
||||
def usage():
|
||||
print ('usage: %s [-d] [-p pagenos] [-P password] [-c codec] '
|
||||
'[-D direction] [-M char_margin] [-L line_margin] [-W word_margin] '
|
||||
'[-n] [-D direction] [-M char_margin] [-L line_margin] [-W word_margin] '
|
||||
'[-t text|html|xml|tag] [-o output] file ...' % argv[0])
|
||||
return 100
|
||||
try:
|
||||
(opts, args) = getopt.getopt(argv[1:], 'dp:P:c:D:M:L:W:t:o:C:D:m:')
|
||||
(opts, args) = getopt.getopt(argv[1:], 'dp:P:c:nD:M:L:W:t:o:C:D:m:')
|
||||
except getopt.GetoptError:
|
||||
return usage()
|
||||
if not args: return usage()
|
||||
|
@ -46,6 +46,7 @@ def main(argv):
|
|||
elif k == '-c': codec = v
|
||||
elif k == '-o': outfile = v
|
||||
elif k == '-s': scale = float(v)
|
||||
elif k == '-n': laparams = None
|
||||
elif k == '-D': laparams.direction = v
|
||||
elif k == '-M': laparams.char_margin = float(v)
|
||||
elif k == '-L': laparams.line_margin = float(v)
|
||||
|
|
Loading…
Reference in New Issue