fix typo (pointed by JaredU)
git-svn-id: https://pdfminerr.googlecode.com/svn/trunk/pdfminer@152 1aa58f4a-7d42-0410-adbc-911cccaed67cpull/1/head
parent
6bc2bebb5b
commit
626e36f39c
|
@ -19,7 +19,7 @@ Python PDF parser and analyzer
|
||||||
|
|
||||||
<div align=right class=lastmod>
|
<div align=right class=lastmod>
|
||||||
<!-- hhmts start -->
|
<!-- hhmts start -->
|
||||||
Last Modified: Wed Nov 4 18:47:49 JST 2009
|
Last Modified: Thu Nov 5 22:23:07 JST 2009
|
||||||
<!-- hhmts end -->
|
<!-- hhmts end -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -179,13 +179,13 @@ For non-ASCII languages, you can specify the output encoding
|
||||||
<p>
|
<p>
|
||||||
Examples:
|
Examples:
|
||||||
<blockquote><pre>
|
<blockquote><pre>
|
||||||
$ <strong>pdf2txt.py samples/naacl06-shinyama.pdf -o output.html</strong>
|
$ <strong>pdf2txt.py -o output.html samples/naacl06-shinyama.pdf</strong>
|
||||||
(extract text as an HTML file whose filename is output.html)
|
(extract text as an HTML file whose filename is output.html)
|
||||||
|
|
||||||
$ <strong>pdf2txt.py -c euc-jp samples/jo.pdf -D V -o output.html</strong>
|
$ <strong>pdf2txt.py -c euc-jp -D V -o output.html samples/jo.pdf</strong>
|
||||||
(extract a Japanese HTML file in vertical writing, CMap is required)
|
(extract a Japanese HTML file in vertical writing, CMap is required)
|
||||||
|
|
||||||
$ <strong>pdf2txt.py -P mypassword secret.pdf -o output.txt</strong>
|
$ <strong>pdf2txt.py -P mypassword -o output.txt secret.pdf</strong>
|
||||||
(extract a text from an encrypted PDF file)
|
(extract a text from an encrypted PDF file)
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,9 @@ class LayoutItem(object):
|
||||||
self.set_bbox(bbox)
|
self.set_bbox(bbox)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return ('<item bbox=%s>' % (self.get_bbox()))
|
||||||
|
|
||||||
def set_bbox(self, (x0,y0,x1,y1)):
|
def set_bbox(self, (x0,y0,x1,y1)):
|
||||||
if x1 < x0: (x0,x1) = (x1,x0)
|
if x1 < x0: (x0,x1) = (x1,x0)
|
||||||
if y1 < y0: (y0,y1) = (y1,y0)
|
if y1 < y0: (y0,y1) = (y1,y0)
|
||||||
|
@ -130,8 +133,8 @@ class LayoutItem(object):
|
||||||
self.height = y1-y0
|
self.height = y1-y0
|
||||||
return
|
return
|
||||||
|
|
||||||
def __repr__(self):
|
def get_bbox(self):
|
||||||
return ('<item bbox=%s>' % (self.get_bbox()))
|
return '%.3f,%.3f,%.3f,%.3f' % (self.x0, self.y0, self.x1, self.y1)
|
||||||
|
|
||||||
def hoverlap(self, obj):
|
def hoverlap(self, obj):
|
||||||
assert isinstance(obj, LayoutItem)
|
assert isinstance(obj, LayoutItem)
|
||||||
|
@ -147,9 +150,6 @@ class LayoutItem(object):
|
||||||
else:
|
else:
|
||||||
return min(abs(self.y0-obj.y1), abs(self.y1-obj.y0))
|
return min(abs(self.y0-obj.y1), abs(self.y1-obj.y0))
|
||||||
|
|
||||||
def get_bbox(self):
|
|
||||||
return '%.3f,%.3f,%.3f,%.3f' % (self.x0, self.y0, self.x1, self.y1)
|
|
||||||
|
|
||||||
def get_margin(self):
|
def get_margin(self):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue