• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Radio button entry not being saved with Emdeb API

New Here ,
Dec 08, 2022 Dec 08, 2022

Copy link to clipboard

Copied

Hi, new API user here.

I have a PDF that has a several questions followed by Yes/No checkboxes.

YesNoCheckbox.PNG

Some of these checkboxes are simple checkboxes (where both Yes and No can be checked) and some act as radio buttons where only either Yes OR No can be checked (don't ask me why the inconsistancy, this is a PDF from one of our clients).

I use previewFile from the Embed API to load the PDF into a browser.

I then check some of the Yes/No checkboxes and save the contents using the save callback:

                /* Register save callback */
                adobeDCView.registerCallback(
                    AdobeDC.View.Enum.CallbackType.SAVE_API,
                    function (metaData, content, options) {
                        /* Write down your own save implementation here... and based on that resolve or reject response in given format */
                        /* Save callback success case */
                        console.log("I'm in the save callback")
                        var base64PDF = arrayBufferToBase64(content);
                        var fileURL = "data:application/pdf;base64," + base64PDF;
                        savedDoc = fileURL;

 

I then use pdf-lib to read the contents of the fields

pdf-lib reports all these fields of type 'PDFCheckBox' which has a method called isChecked().

When I call isChecked() on one of the fields that acts as a single checkbox, the value is always accurate (ie. true if I checked the box, false if I did not).

When I call isChecked() on one of the fields that acts as a radio button, the value returned is always false even when I either the 'Yes' or 'No' box is checked.

 

One other interesting piece of information.  If the original PDF file read in via previewFile has the Yes radio button checkbox checked, when I call isChecked(), I get the correct value (ie. true) back, so the problem has to do with the ability to set and save this radio button checkbox via the embed API.

 

Thanks in advance for any assistance.

 

 

 

 

Views

140

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2022 Dec 08, 2022

Copy link to clipboard

Copied

Can you share the PDF in question?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 08, 2022 Dec 08, 2022

Copy link to clipboard

Copied

Hi Joel,  Sure, the original is attached.  Questions 1 - 5 and 9 are the ones that are not working.

I believe all the others are fine (although I must admit, I did not test every one).

I don't have a copy of the 'saved' PDF from after I checked the Yes boxes via the API.  If you would like to see that as well, I can try to get a copy of that.

 

Thanks,

John

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2022 Dec 14, 2022

Copy link to clipboard

Copied

LATEST

Any progress/updates on this issue?  I just realized that I posted this to the 'Acrobat Services API' community.  Should I post this on the Embed API community since its related to the Embed API or can someone hear help me?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources