summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2012-09-16 23:27:14 +0200
committerFlorian Bruhin <git@the-compiler.org>2012-09-16 23:27:14 +0200
commit009efdb1eb7e6dd292db33791623be2e2ca0bf15 (patch)
tree70b83c6c87e9282d1813b4eb968c425b3e017ae6
parenta1aec1ea552d3af5f6b21bfa49184dd15d7082c5 (diff)
downloadxojgrep-009efdb1eb7e6dd292db33791623be2e2ca0bf15.tar.gz
xojgrep-009efdb1eb7e6dd292db33791623be2e2ca0bf15.zip
First PDF page has index 0, not 1
-rw-r--r--xojgrep.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/xojgrep.py b/xojgrep.py
index 9fb5163..4938b51 100644
--- a/xojgrep.py
+++ b/xojgrep.py
@@ -106,11 +106,11 @@ class PDFFile:
def getcontent(self):
pagecount = self.doc.numPages
content = []
- for pn in range(1, pagecount + 1):
+ for pn in range(0, pagecount):
page = self.doc.getPage(pn)
text = page.extractText()
if text:
- content.append((pn, [text]))
+ content.append((pn + 1, [text]))
return content