8 Replies Latest reply on Aug 28, 2014 4:26 PM by Alexito

    show image in different window

    Alexito

      Dear All,

       

      as mentioned in this thread (initialize dialog with img) there is bug in Acrobat XI to show an image in a dialog box crated using JS. Are there other possibilities to show the image in a different window (pop-up, create a new pdf and show in new window etc.)?

      The image (legend for the map) is already imported in document on the second page, but it has to be shown to the same time when I am looking at the first page(map) in order to avoid scrolling down and up.


      Any suggestions would be appreciated.

       

      thanks and regards,

      Alex

        • 1. Re: show image in different window
          MichaelN Level 3

          One option is to create a button on page 1 that has a Show/Hide action to show the image when the mouse is over it.

          • 2. Re: show image in different window
            Alexito Level 1

            with the button it is a good idea, but by zooming on page 1, the button will be not always visible, as the button can be out of visible part of the page 1.

            Is it possible to create a big ToolButton for a JS window using app.addToolButton? So I could load the button with a bigger image, and not only with 20x20 big image.

            • 3. Re: show image in different window
              George_Johnson MVP & Adobe Community Professional

              Another thing you can do is create a PDF that just contains the image. You can include this image-only PDF as an attachment and have a link to it so that when it's clicked it will open in a new window. You can set it to hide the UI elements like the toolbar and menus. If properly set up, it will open as a separate window that is just as large as the image. You can add a button that executes the File > Close menu item so the user can click it to close the image PDF. It won't be modal like a custom dialog and you can't have toolbar buttons bigger than 20x20 pixels, so this may be the best you can do. In order to see both PDFs at the same time, the master PDF window can't be maximized or the image will be covered by the master PDF window when the focus is returned to the master PDF.

              • 4. Re: show image in different window
                Alexito Level 1

                Very nice idea, I appreciate it very much! I started to implement it immediately. After I put the attachment, the JS code below was generated. I open the legend using this function ( this.exportDataObject({cName:"legend.pdf", nLaunch: 2}) ) and put it before //</ACRO_script>, otherwise it is deleted automatically after closing.

                Is it possible to hide UI on document level? Because this function (app.hideMenuItem();) is not allowed cause of security prevention(even using trusted function:( var hideMenu = app.trustedFunction(function() { app.beginPriv(); app.hideMenuItem(); app.endPriv(); });

                And how can I hide remaining buttons and panels right and left? Could not find in documentation .

                 

                //<Document-Level>

                //<ACRO_source>ADBE::FileAttachmentsCompatibility</ACRO_source>

                //<ACRO_script>

                /*********** belongs to: Document-Level:ADBE::FileAttachmentsCompatibility ***********/

                CODE, like var v = app.viewerVersion;if (v < 7) { .....}

                 

                this.exportDataObject({cName:"legend.pdf", nLaunch: 2});

                //</ACRO_script>

                //</Document-Level>

                • 5. Re: show image in different window
                  George_Johnson MVP & Adobe Community Professional

                  You don't need to use JavaScript at all. To have a document hide the toolbars and menus, you'd select: File > Properties > Initial View

                   

                  and you'll see where to do that. I'd also recommend selecting "Resize window to initial page" and maybe "Center window on screen".

                   

                  After attaching the image PDF, you'd just set up a link of a button with a "Go to a page view" action so it opens the attachment PDF. After setting this up, you should edit the action so that it always opens in a new window, as opposed to not or relying on whatever the user preference set to.

                   

                  I realize some of this may be confusing since there are a lot of little and perhaps obscure details that need to be set just right, but post again if you get stuck or would like to see a sample that's set up like the way I have in mind.

                  • 6. Re: show image in different window
                    Alexito Level 1

                    It is exactly what I need, I am so grateful!

                     

                    I have got it with the link, but it opens the attached file twice and after closing the acrobat crashes.

                    My steps:

                    1.Tools-Content Editing - Add or Edit Link

                    2. make a small rectangle and choose "Go to a page view"

                    3. I do dubble - click on the attached document, it opens and I press "Set Link".

                    4. On the new opened file : File->Properites->Initial View and set the desired options.

                     

                    after saving, when I press on the rectangle and two documents open and the master pdf is closed, sometimes the program crashes. What could be the problem?

                    • 7. Re: show image in different window
                      George_Johnson MVP & Adobe Community Professional

                      That's strange. You should check to see how the link action is set up. You should configure it so that the attachment PDF opens in a new window.

                      • 8. Re: show image in different window
                        Alexito Level 1

                        I got it using JS and it is fine. You mentioned in the previous post, that it would be possible to change the focus to the master window. How can I do it? I have two screens, so the master window wouldn't cover the new window.