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

get_existing_pdf_fields_with_context #79

Open
BryceStevenWilley opened this issue Jan 11, 2023 · 0 comments
Open

get_existing_pdf_fields_with_context #79

BryceStevenWilley opened this issue Jan 11, 2023 · 0 comments

Comments

@BryceStevenWilley
Copy link
Contributor

Taking out an unfinished function until it can actually be finished. The idea is that it should return each field in the PDF, with all of the text surrounding it.

def get_existing_pdf_fields_with_context(
    in_file: Union[str, Path, BinaryIO]
) -> Iterable:
    in_pdf = Pdf.open(in_file)
    text_in_pdf = get_textboxes_in_pdf(in_file)
    fields = [
        {"type": field.FT, "var_name": str(field.T), "all": field}
        for field in iter(in_pdf.Root.AcroForm.Fields)
    ]
    return fields
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