6 Replies Latest reply on Mar 23, 2009 1:43 PM by (Roberto_Falcó)

    Compare PDF: How to programmatically simulate ENTER key.

      Hi,

      We are using Acrobat 8.0. Using Visual Basic, we are opening two PDF files in Acrobat 8.0 professional.We are comparing those two documents using MenuitemExecute(DIGSIG:CompareDocuments ) command and generating the side by side comparison file programatically.

      During this process after executing the command "MenuitemExecute(DIGSIG:CompareDocuments )" adobe is displaying "Compare Documents" dialog box where the user need to click OK on it in order to continue with the comparison.

      My requirement is to suppress the dialog box and automate the process. Our application is developed in Visual basic.

      Could you please let me know how to suppress the dialog box using Visual basic. Is it possible using VB or any alternatives for this. Because we need to compare many PDF documents so clicking OK every time requires user intervention.

      Thanks for your help in advance.
        • 1. Re: Compare PDF: How to programmatically simulate ENTER key.
          Hey ,
          Did you get the solution for that . Even I am stuck with the "
          CompareDocuments pop up window" .
          • 2. Re: Compare PDF: How to programmatically simulate ENTER key.
            Patrick Leckey Level 3
            There are no methods in the Acrobat SDK or Acrobat JavaScript to simulate pressing the enter key. You would need to use the standard method for whatever programming language you are using.
            • 3. Re: Compare PDF: How to programmatically simulate ENTER key.
              Level 1
              Thanks for the reply PDL.
              I am using VbScript [ Excel 2003 ] for comparison between the pdfs.

              Correct me if i am wrong ,but i was thinking that if by using "MenuitemExecute(DIGSIG:CompareDocuments )" ,we can reach to that pop out dialog then why not all the way till the result pdf is generated. Because it makes sense to either have APIs available for a feature completely [programatically] or not at all .
              • 4. Re: Compare PDF: How to programmatically simulate ENTER key.
                Patrick Leckey Level 3
                You seem to be confusing what you think is a Comparison API with the ManuItemExecute API. MenuItemExecute does exactly what its name says it will - it executes a menu item. Nothing more.

                > Because it makes sense to either have APIs available for a feature completely [programatically] or not at all .

                You're right - and there is no direct interface to the document comparison APIs from Acrobat's IAC interface. In order to access comparison programatically you need to create a plug-in in C/C++.

                Simulating a "Press Enter" is extremely bad practice for a production environment and I highly recommend you do not use this method if you are planning to deploy this application to end-users.
                • 5. Re: Compare PDF: How to programmatically simulate ENTER key.
                  Level 1
                  Yeah , you are right .And even if I am able to simulate the "Enter"key , I wont be able to select the various options available on that pop up dialog [as I will have to go with the default values always],
                  • 6. Re: Compare PDF: How to programmatically simulate ENTER key.
                    No hablo el inglés, así que traduciré con Google: ¡Lo siento!

                    ¿Quieres entrar la tecla ENTER pero desde VB ? ... ok , Tu puedes utilizar SendKeys "{ENTER}"


                    I do not speak English, so I will translate with Google: Sorry

                    Want to get the ENTER key but from VB? ... ok, you can use SendKeys "{ENTER}"

                    link
                    http://www.ayudaexcel.com/foro/macros-y-programacion-vba/2785-extraer-dato-de-un-archivo-p df.html#post12531

                    ' Shell ("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe C:\borrar\76298132.pdf")
                    Application.Run "BOTON_pDF.xls!Macro1" ' llamo la macro que arranca la aplicacion y el fichero .pdf

                    SendKeys "+^(F)" ' lanzo la secuencia ''buscar'' mediante mayúsculas (+) , control (^), y la letra F
                    SendKeys "200911111" ' lanzo la búsqueda de la parte del fichero 200911111
                    Application.Wait Now + TimeValue("0:00:05") ' hago una pausa
                    SendKeys "{ENTER}" ' lanzo la tecla intro con la cadena {ENTER}
                    SendKeys "^(c)" ' copio la cadena que por defecto se marca al completo ejemplo 200911111***
                    SendKeys "+^(s)" ' inicio el salvado del fichero
                    Application.Wait Now + TimeValue("0:00:05") ' hago una pausa
                    SendKeys "{END}" ' me posiciono al final del nombre del fichero
                    Application.Wait Now + TimeValue("0:00:05") ' hago una pausa
                    SendKeys "{LEFT}{LEFT}{LEFT}{LEFT}" ' Me pongo justo delante del punto del pdf osea .pdf
                    SendKeys "(_)"
                    SendKeys "^(v)" ' Pego la cadena anteriormente buscada
                    Application.Wait Now + TimeValue("0:00:05") ' hago una pausa
                    SendKeys "{ENTER}" ' Pincho intro para guardar
                    Application.Wait Now + TimeValue("0:00:05")
                    SendKeys "^(q)" ' Cierro la ventana del .pdf

                    Aqui un link

                    Here more information

                    http://javascripts.astalaweb.com/Ayuda/html/wsmthsendkeys.asp

                    I have a little problem:
                    1 .- I need to open a name.pdf,
                    2 .- Search for a word 2009NNNNNN
                    3 .- Save the file with your name_2009NNNNN.pdf

                    Can you help?

                    Yo tengo un pequeño problema:
                    1.- Necesito abrir un name.pdf ,
                    2.- Buscar una palabra 2009NNNNNN
                    3.- Guardar el archivo con su name_2009NNNNN.pdf

                    ¿Puedes ayudarme?

                    Thanks