Skip to content

[BUG] Selecting radio button results in an invalid pdf. #493

@wojciechsmigielski96

Description

@wojciechsmigielski96

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"
    }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions