From 61042f0b9bbfa924b8ba4d0f0cc81ac0690a85c9 Mon Sep 17 00:00:00 2001 From: Alex <31130826+nasmi3@users.noreply.github.com> Date: Fri, 3 Feb 2023 14:21:26 +0900 Subject: [PATCH] Fix bash errors for generate_dictionary Allow to use the argument `pdftk_command` on the `generate_dictionary` function if the executable for pdftk server is at a custom location --- pdfformfields/wrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdfformfields/wrapper.py b/pdfformfields/wrapper.py index dc7d628..eaa6a37 100644 --- a/pdfformfields/wrapper.py +++ b/pdfformfields/wrapper.py @@ -112,7 +112,7 @@ def get_form_field_ids(input_pdf: str, output: str, pdftk_command: str = None): raise OSError(bash_error_message(pdftk_command)) -def generate_dictionary(input_pdf: str, verbose: bool = False): +def generate_dictionary(input_pdf: str, verbose: bool = False, pdftk_command: str = None): """ Super hacky function which creates a copy-pastable Python dictionary code. Good for increasing productivity. @@ -135,7 +135,7 @@ def generate_dictionary(input_pdf: str, verbose: bool = False): """ temp_form_field_dump = "temp_form_field_dump.txt" - get_form_field_ids(input_pdf, temp_form_field_dump) + get_form_field_ids(input_pdf, temp_form_field_dump, pdftk_command) with open(temp_form_field_dump) as fh: dict_str = ""