Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in write_fillable_pdf in fillpdfs.py #55

Open
jbergma1 opened this issue May 2, 2024 · 0 comments
Open

Bug in write_fillable_pdf in fillpdfs.py #55

jbergma1 opened this issue May 2, 2024 · 0 comments

Comments

@jbergma1
Copy link

jbergma1 commented May 2, 2024

Hi,

starting on line 207, the code currently reads:

                if target and annotation[SUBTYPE_KEY] == WIDGET_SUBTYPE_KEY:
                    key = target[ANNOT_FIELD_KEY][1:-1] # Remove parentheses
                    target_aux = target
                    while target_aux['/Parent']:
                        key = target['/Parent'][ANNOT_FIELD_KEY][1:-1] + '.' + key
                        target_aux = target_aux['/Parent']

Line 211 should be:

key = target_aux['/Parent'][ANNOT_FIELD_KEY][1:-1] + '.' + key

As currently implemented, the code will fail to find fields in the corresponding data_dict if their parents have parents (no proper loop up the ladder of parents).

Apart from that, thank you for your very helpful library!

Kind regards,
Johannes Bergmann

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant