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

Radio options not rendered when save document #15096

Closed
jegathesan opened this issue Jun 24, 2022 · 7 comments · Fixed by #18845
Closed

Radio options not rendered when save document #15096

jegathesan opened this issue Jun 24, 2022 · 7 comments · Fixed by #18845
Assignees
Labels

Comments

@jegathesan
Copy link

Sample File:
SmartFormAllFields.pdf

Configuration:

  • Web browser and its version: Chrome (102.0.5005.115), Firefox (99.0.1)
  • Operating system and its version: MacOS, Windows
  • Commit: a334a21
  • Is a browser extension: No

Steps to reproduce the problem:

  1. Use above sample pdf.
  2. Modify radio options

What is the expected behavior?

  1. Only selected radio button should checked when saving document using saveDocument()

What went wrong?

  1. When save document radio button not selected properly

Screenshot 2022-06-24 at 10 14 18 PM

@calixteman
Copy link
Contributor

The two radios (62R and 66R) don't have a P entry, hence their pageIndex is -1:

static async _getPageIndex(xref, ref, pdfManager) {

and when a radio is clicked we must store its value and the one for its siblings in the annotationStorage but when try to collect the siblings the object are just skipped because of the pageIndex:
if (page === -1) {

@calixteman
Copy link
Contributor

According to the specs the P entry is optional, so we should find an other way to get the pageIndex.

@Snuffleupagus, any ideas ?

@Snuffleupagus
Copy link
Collaborator

and when a radio is clicked we must store its value and the one for its siblings in the annotationStorage but when try to collect the siblings the object are just skipped because of the pageIndex:

if (page === -1) {

Do we actually need to check the page-index there, or could we just remove that check?

More generally: where do we actually need the page-index, in the scripting implementation?

@calixteman
Copy link
Contributor

There is a page property in the Field object:
https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsapiref.pdf#page=433&zoom=auto,-106,711

You added this page check:
#14023

I think it should be fine to remove it, we just "need" (I'm not sure to be able to imagine a form where using this property could be really useful) to find a way to get the number.

@Snuffleupagus
Copy link
Collaborator

You added this page check:
#14023

Whoops; unfortunately I didn't have a good reason for doing that, but rather figured that it'd make sense (without really knowing anything about the scripting-side of things).

@MallRoy
Copy link

MallRoy commented Jun 30, 2022

We are also facing the same issue. any update on this @Snuffleupagus @calixteman?

@calixteman calixteman self-assigned this Jul 9, 2022
@calixteman
Copy link
Contributor

This pdf is a corrupt: in Root::Fields, the object 10R has 2 children 62Rand 66R but those ones don't have aParent entry which is this case required (table 220):
https://christianhaider.de/dokuwiki/lib/exe/fetch.php?media=pdf:pdf32000_2008.pdf#page=440&zoom=auto,-147,370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants