From 620745c8121c6bd5914c4dccd2f920ccd6ffa4d4 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Mon, 12 Dec 2016 15:09:11 -0800 Subject: [PATCH] =?UTF-8?q?pipeline:=20don=E2=80=99t=20use=20qpdf=20to=20c?= =?UTF-8?q?heck=20page=20count=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already know the number of pages at this stage. --- ocrmypdf/pipeline.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ocrmypdf/pipeline.py b/ocrmypdf/pipeline.py index 46453dd8..b03333dc 100644 --- a/ocrmypdf/pipeline.py +++ b/ocrmypdf/pipeline.py @@ -282,7 +282,8 @@ def split_pages( options.input_file)) raise InputFileError() - npages = qpdf.get_npages(input_file, log) + pdfinfo = context.get_pdfinfo() + npages = len(pdfinfo) qpdf.split_pages(input_file, work_folder, npages) from glob import glob