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

Help with Understanding #1

Open
RedDirtBits opened this issue Dec 3, 2021 · 2 comments
Open

Help with Understanding #1

RedDirtBits opened this issue Dec 3, 2021 · 2 comments

Comments

@RedDirtBits
Copy link

First, please, forgive me for intruding on you like this. I saw no other way to reach out to you.

I have been working on a Python program to fill out Unified Credentialing Applications similar to this one but for a different state. It has been a journey trying to sort out all that needs to be navigated with PDF's. I was trying to figure out how to deal with check boxes and came across your post here. It has been helpful, but there is much I am unable to piece together in your article.

In the article you mention print (annotation['/AP']['/N'].keys()) but I am unable to sort out what annotation is with respect to your code. I looked at the GitHub repository but am not able to glean what it is referencing.

In another (brilliant) function that you show:

def field_type(annotation):
    ft = annotation['/FT']
    ff = annotation['/Ff']

    if ft == '/Tx':
        return 'text'
    if ft == '/Ch':
        if ff and int(ff) & 1 << 17:  # test 18th bit
            return 'combo'
        else:
            return 'list'
    if ft == '/Btn':
        if ff and int(ff) & 1 << 15:  # test 16th bit
            return 'radio'
        else:
            return 'checkbox'

You use the annotation again, but the only thing I can come up with is its the form field name? But another thing came up in trying to emulate that code. I have no /Ff in the few PDF's I have looked at so far. Without that, is it possible to test the bits?

Again, forgive me for the intrusion like this. I have beat my head against my computer screen, laptop and desk for a couple days now trying to sort this out and this was the only way I saw to reach out to you. If you can offer any assistance that would be awesome. If not, I completely understand.

@summerswallow
Copy link

Sorry took so long. Since this repo had been around for a long time and there had been no questions, I had missed this.
Let me know if this is still relevant for you. If so I will take a look.

@RedDirtBits
Copy link
Author

It's all good. I never got it all sorted out and it kind of fell to the back burner. The ultimate goal was to take the credentialing form, point it to the user information/data and it fill in the form and save it. I just never could work through the PDF structure to get at all the fields.

I had conversations with some of the traveling nurses at the hospital I work at (Network Engineer) and it seemed to be a common complaint about how long it took to fill out that form in particular and others and the number of times they had to do so. I had hoped to leverage my meager Python knowledge to help them out but never could sort it all out.

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

2 participants