Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Fix bash errors for generate_dictionary #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pdfformfields/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 = ""
Expand Down