From a3e936b09a509339de6bf8408b08bd0a6afb5c90 Mon Sep 17 00:00:00 2001 From: cccs-rs Date: Wed, 8 Nov 2023 18:13:53 +0000 Subject: [PATCH] String cast page range values --- document_preview/document_preview.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/document_preview/document_preview.py b/document_preview/document_preview.py index f5bd617..4ef9000 100644 --- a/document_preview/document_preview.py +++ b/document_preview/document_preview.py @@ -22,9 +22,9 @@ def pdfinfo_from_path(fp: str): def convert_from_path(fp: str, output_directory: str, first_page=1, last_page=None): - pdf_conv_command = ["pdftoppm", "-jpeg", "-f", first_page] + pdf_conv_command = ["pdftoppm", "-jpeg", "-f", str(first_page)] if last_page: - pdf_conv_command += ["-l", last_page] + pdf_conv_command += ["-l", str(last_page)] subprocess.run(pdf_conv_command + [fp, os.path.join(output_directory, "output")], capture_output=True)