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

Fixed checkbox not checked in FormWrapper #559

Closed

Conversation

73VW
Copy link

@73VW 73VW commented Apr 8, 2024

fix for #558

So I've reverse engineered the value of the annotation when it was checked and not checked and I have found that you were missing the value of /V.

The value of annot in the base template:

{'/AP': {'/D': {'/Off': IndirectObject(19, 0, 139905065837776), '/Yes': IndirectObject(20, 0, 139905065837776)}, '/N': {'/Off': IndirectObject(22, 0, 139905065837776), '/Yes': IndirectObject(23, 0, 139905065837776)}}, '/AS': '/Off', '/F': 4, '/FT': '/Btn', '/MK': {'/BC': [0.0], '/BG': [1], '/CA': '4'}, '/P': IndirectObject(4, 0, 139905065837776), '/Rect': [358.874, 664.717, 377.354, 683.197], '/Subtype': '/Widget', '/T': 'check', '/Type': '/Annot', }

The value of the annot in a manually checked and saved file:

{'/AP': {'/D': {'/Off': IndirectObject(19, 0, 139905065837776), '/Yes': IndirectObject(20, 0, 139905065837776)}, '/N': {'/Off': IndirectObject(22, 0, 139905065837776), '/Yes': IndirectObject(23, 0, 139905065837776)}}, '/AS': '/Yes', '/F': 4, '/FT': '/Btn', '/MK': {'/BC': [0.0], '/BG': [1], '/CA': '4'}, '/P': IndirectObject(4, 0, 139905065837776), '/Rect': [358.874, 664.717, 377.354, 683.197], '/Subtype': '/Widget', '/T': 'check', '/Type': '/Annot', '/V': '/Yes'}

The value of the annot after checking it with your package:

{'/AP': {'/D': {'/Off': IndirectObject(19, 0, 139905065837776), '/Yes': IndirectObject(20, 0, 139905065837776)}, '/N': {'/Off': IndirectObject(22, 0, 139905065837776), '/Yes': IndirectObject(23, 0, 139905065837776)}}, '/AS': '/Yes', '/F': 4, '/FT': '/Btn', '/MK': {'/BC': [0.0], '/BG': [1], '/CA': '4'}, '/P': IndirectObject(4, 0, 139905065837776), '/Rect': [358.874, 664.717, 377.354, 683.197], '/Subtype': '/Widget', '/T': 'check', '/Type': '/Annot'

I've concluded that you had to put the /V (value I think) and this seems to work.

Also, I've added the option to uncheck a checkbox if you need to.

Best

@chinapandaman
Copy link
Owner

Closing as this duplicates #564

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

Successfully merging this pull request may close these issues.

2 participants