From 626e36f39ccfe6d1a59aac585c83545de2c4e0b0 Mon Sep 17 00:00:00 2001 From: "yusuke.shinyama.dummy" Date: Fri, 6 Nov 2009 15:06:59 +0000 Subject: [PATCH] fix typo (pointed by JaredU) git-svn-id: https://pdfminerr.googlecode.com/svn/trunk/pdfminer@152 1aa58f4a-7d42-0410-adbc-911cccaed67c --- docs/index.html | 8 ++++---- pdfminer/layout.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/index.html b/docs/index.html index 75412e3..62512d3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -19,7 +19,7 @@ Python PDF parser and analyzer
-Last Modified: Wed Nov 4 18:47:49 JST 2009 +Last Modified: Thu Nov 5 22:23:07 JST 2009
@@ -179,13 +179,13 @@ For non-ASCII languages, you can specify the output encoding

Examples:

-$ pdf2txt.py samples/naacl06-shinyama.pdf -o output.html
+$ pdf2txt.py -o output.html samples/naacl06-shinyama.pdf
 (extract text as an HTML file whose filename is output.html)
 
-$ pdf2txt.py -c euc-jp samples/jo.pdf -D V -o output.html
+$ pdf2txt.py -c euc-jp -D V -o output.html samples/jo.pdf
 (extract a Japanese HTML file in vertical writing, CMap is required)
 
-$ pdf2txt.py -P mypassword secret.pdf -o output.txt
+$ pdf2txt.py -P mypassword -o output.txt secret.pdf
 (extract a text from an encrypted PDF file)
 
diff --git a/pdfminer/layout.py b/pdfminer/layout.py index cad790a..77ac3a2 100644 --- a/pdfminer/layout.py +++ b/pdfminer/layout.py @@ -119,6 +119,9 @@ class LayoutItem(object): self.set_bbox(bbox) return + def __repr__(self): + return ('' % (self.get_bbox())) + def set_bbox(self, (x0,y0,x1,y1)): if x1 < x0: (x0,x1) = (x1,x0) if y1 < y0: (y0,y1) = (y1,y0) @@ -130,8 +133,8 @@ class LayoutItem(object): self.height = y1-y0 return - def __repr__(self): - return ('' % (self.get_bbox())) + def get_bbox(self): + return '%.3f,%.3f,%.3f,%.3f' % (self.x0, self.y0, self.x1, self.y1) def hoverlap(self, obj): assert isinstance(obj, LayoutItem) @@ -147,9 +150,6 @@ class LayoutItem(object): else: 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): return 0