diff --git a/docs/index.html b/docs/index.html index 837b7e1..1e13cf8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,7 +9,7 @@
-C
diff --git a/pdfminer/layout.py b/pdfminer/layout.py
index 9426ad3..6477eff 100644
--- a/pdfminer/layout.py
+++ b/pdfminer/layout.py
@@ -676,13 +676,20 @@ class LTLayoutContainer(LTContainer):
for obj in empties:
obj.analyze(laparams)
textboxes = list(self.group_textlines(laparams, textlines))
- if textboxes:
+ if -1 <= laparams.boxes_flow and laparams.boxes_flow <= +1 and textboxes:
self.groups = self.group_textboxes(laparams, textboxes)
assigner = IndexAssigner()
for group in self.groups:
group.analyze(laparams)
assigner.run(group)
textboxes.sort(key=lambda box: box.index)
+ else:
+ def getkey(box):
+ if isinstance(box, LTTextBoxVertical):
+ return (0, -box.x1, box.y0)
+ else:
+ return (1, box.y0, box.x0)
+ textboxes.sort(key=getkey)
self._objs = textboxes + otherobjs + empties
return
@@ -725,4 +732,4 @@ class LTPage(LTLayoutContainer):
def __repr__(self):
return ('<%s(%r) %s rotate=%r>' %
(self.__class__.__name__, self.pageid,
- bbox2str(self.bbox), self.rotate))
\ No newline at end of file
+ bbox2str(self.bbox), self.rotate))