Skip to content

Commit

Permalink
Merge pull request #81 from CybercentreCanada/AL-2766
Browse files Browse the repository at this point in the history
String cast page range values
  • Loading branch information
cccs-rs authored Nov 8, 2023
2 parents 0578544 + a3e936b commit 240e120
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions document_preview/document_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 240e120

Please sign in to comment.