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] Selecting radio button results in an invalid pdf. #493

Open
wojciechsmigielski96 opened this issue May 20, 2022 · 2 comments
Open

Comments

@wojciechsmigielski96
Copy link

wojciechsmigielski96 commented May 20, 2022

Description

I have a simple pdf with 3 choices radio button.
radioButtonExample.pdf
Screenshot 2022-05-20 at 14 15 51

Field data of the pdf with no radio button selection:

[
    {
        "name": "RadioButton",
        "value": ""
    },
    {
        "name": "RadioButton",
        "value": "Off",
        "options": [
            "1",
            "Off"
        ]
    },
    {
        "name": "RadioButton",
        "value": "Off",
        "options": [
            "2",
            "Off"
        ]
    },
    {
        "name": "RadioButton",
        "value": "Off",
        "options": [
            "3",
            "Off"
        ]
    }
]

Field data of the pdf with the third option selected.

[
    {
        "name": "RadioButton",
        "value": ""
    },
    {
        "name": "RadioButton",
        "value": "Off",
        "options": [
            "1",
            "Off"
        ]
    },
    {
        "name": "RadioButton",
        "value": "Off",
        "options": [
            "2",
            "Off"
        ]
    },
    {
        "name": "RadioButton",
        "value": "3",
        "options": [
            "3",
            "Off"
        ]
    }
]

Running pdf_form_fill_json.go with Field data of the pdf with the third option selected results in broken pdf
Only the third option is visible.

Screenshot 2022-05-20 at 14 15 37

The broken pdf's field data

[
    {
        "name": "RadioButton",
        "value": ""
    },
    {
        "name": "RadioButton",
        "value": "3",
        "options": [
            "1",
            "Off"
        ]
    },
    {
        "name": "RadioButton",
        "value": "3",
        "options": [
            "2",
            "Off"
        ]
    },
    {
        "name": "RadioButton",
        "value": "3",
        "options": [
            "3",
            "Off"
        ]
    }
]

The following field format also didn't work.

[
    {
        "name": "RadioButton",
        "value": "3"
    }
]
@github-actions
Copy link

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

@wojciechsmigielski96
Copy link
Author

wojciechsmigielski96 commented May 20, 2022

I run pdf_form_list_fields.go on the document. The checkbox with radio flag is found instead of RadioBox.

Field 2
Name: RadioButton
 Flags: NoToggleToOff|Radio (49152)
 Button
 - Checkbox
 ..

Field 3
Name: RadioButton
 Flags: NoToggleToOff|Radio (49152)
 Button
 - Checkbox

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