9 Replies Latest reply on Jul 21, 2016 4:45 AM by joerg_d_6110

    app.execDialog fails with multiple documents

    markn79374433 Level 1

      I have several forms, each with a button mouseup callback that uses app.execDialog(...).

       

      When multiple forms are concurrently open, only the first form that called app.execDialog will function properly; all other forms fail to render a dialog upon a button click.

       

      If only one form is open, everything functions properly, so this seems to be related to a document-level javascript tie-in with the app object that fails to establish when subsequent documents are opened by the application.

       

      Has anyone else observed similar behavior? If so, has anyone determined a solution or work-around?

       

      I've confirmed this on Acrobat DC Standard and DC Pro, both Windows 7 and Windows 10.

        • 1. Re: app.execDialog fails with multiple documents
          Bernd Alheit Adobe Community Professional & MVP

          What code do use at document level?

          • 2. Re: app.execDialog fails with multiple documents
            gkaiseril MVP & Adobe Community Professional

            This sounds like a scope issue.

             

            What happens when this script is placed in JavaScript folder?

            1 person found this helpful
            • 3. Re: app.execDialog fails with multiple documents
              Karl Heinz Kremer Adobe Community Professional

              Are you getting any errors on the JavaScript console?

               

              Are all dialogs defined with unique names?

              • 4. Re: app.execDialog fails with multiple documents
                markn79374433 Level 1

                I have a document-level function to define the dialog contents:

                 

                function MakeDialog(){
                    return{
                        initialize: function(dialog){},
                        commit: function(dialog){},
                        ok: function(dialog){},
                        cancel: function(dialog){},

                 

                        description:
                        {
                            name: "My dialog",
                            elements:
                            [
                            {
                            type: "static_text",
                            name: "Dialog contents",
                            bold: true,
                            font: "dialog",
                            height: 20
                            },
                            {
                            type: "ok_cancel",
                            ok_name: "OK",
                            cancel_name: "CANCEL",
                            alignment: "align_center"
                            }
                            ]
                        }
                        }
                }

                 

                This function is called from the "Mouse Up" button action:

                 

                app.execDialog(MakeDialog());

                • 5. Re: app.execDialog fails with multiple documents
                  markn79374433 Level 1

                  Hi Karl,

                   

                  I'm not getting any errors on the console.

                   

                  Identical and dissimilar dialog names produce the same result.

                   

                  Curiously, Adobe Reader will render dialogs as expected when multiple files are open; similarly Pro and Standard seem to have been performing until approximately late-May, early-June. Unfortunately, I am using the Interapplication Communication API in the end application, so Reader isn't a good solution for this particular problem.

                   

                  Thanks for your help and input,

                   

                  Mark

                  • 6. Re: app.execDialog fails with multiple documents
                    markn79374433 Level 1

                    Progress! This does appear to be scope-related. Calling app.execDialog from the global/application level folder is resolving the problem. I made the following js function and put it in the application level folder:

                     

                    function AppShowDialog(dialogToShow){
                        app.execDialog(dialogToShow);
                    }

                     

                    I then modified the button "Mouse Up" to the following:

                     

                    AppShowDialog(MakeDialog());

                     

                    ...where MakeDialog() is a document-level function that defines the dialog contents.

                     

                    Thanks,

                     

                    Mark

                    • 7. Re: app.execDialog fails with multiple documents
                      joerg_d_6110 Level 1

                      Hello all,

                       

                      we are using pdf-forms since Acrobat version 8.1 with very complex JavaScript behind. Our users are working with the latest Adobe Reader versions only, so more and more users are upgraded to the DC-version.

                      We face a lot of claims from our users, since Adobe published the DC-version. With inter-PDF communication it is required to have multiple PDF's opened at the same time - but now the app.execDialog()-functions fails rendering the dialogs on any other then the first PDF, that called the app.execDialog()-function. So, first caller wins and all other fail without any error-message.

                       

                      I see, there is a solution based on a script in the global/application folder.

                      This is not working with our application, since the "delivery" and "installation" oft scripts into the folders of some hundred PC's is not possible. Many users open the PDF's in a browser-environment as well.

                       

                      Since the whole thing happens as well with the samples inside the (online) DC-SDK, I expect, this is a BUG and not a planned change.

                      Is there any chance to this fixed by Adobe soon ? It is essential in our project to have this feature supported by the Reader DC.

                       

                      Thanks in advance ...

                       

                      Joerg

                      • 8. Re: app.execDialog fails with multiple documents
                        try67 MVP & Adobe Community Professional

                        I suggest you report it here: Feature Request/Bug Report Form

                        The more people report it as a bug, the better chances it has of being fixed.

                        • 9. Re: app.execDialog fails with multiple documents
                          joerg_d_6110 Level 1

                          Thank you for the hint (and link) to make a Bug-Report out of it - it's done now.