3 Replies Latest reply on May 1, 2011 2:18 PM by complete_noob

    Zip Code Lookup

    complete_noob

      Is it possible to do a live zip code lookup in an Acrobat form? Is it something to do with "APIs" where Acrobat pulls the information in from a website?

       

      Can anyone show me examples or forms they've done this in?

       

      I am what my name implies...a complete noob but, I'm trying to learn.

       

      Thanks a lot for all your help...it is greatly appreciated.

        • 1. Re: Zip Code Lookup
          George_Johnson MVP & Adobe Community Professional

          It's certainly possible, but I don't have any examples to provide you. A form can be set up to submit a requuest to a web server, either using a standard HTTP Post or via SOAP. So either you have to program a web server to return a response (e.g., an FDF) or find an existing web service that allows the type of query you need.

          • 2. Re: Zip Code Lookup
            Thom Parker Level 3

            There are many different web based services for finding postal codes. The US Postal service has a web site here: http://zip4.usps.com/zip4/welcome.jsp

            Also, do a google search on "zip code web service".  You'll find several links.

             

            The Acrobat JavaScript has a SOAP object for accessing a web service, but it only works in Acrobat Pro. There is also an HTTP service, but it only works from a privileged context.   So as simple as this sort of thing should be, it is in fact a pain.  With some work you could create an automation script that would acquire a zip and stuff it into a form. If you went with the Net.HTTP JavaScript Object it would even work in Reader.  But if you wanted to do this from inside a PDF form  you'd have to use a PDF submit form operation. Which means you'd have to write a server script to translate between the PDF submission and the webservice used to get the zip.

             

            Actually, the LiveCycle scripting model has a FormCalc function that will make an HTTP request and acquire the returned HTML.  So I'm pretty sure you could put zip code acquisition code into a LiveCycle form, but I haven't tried it.

             

            Thom Parker
            The source for PDF Scripting Info
            pdfscripting.com

             

            The Acrobat JavaScript Reference, Use it Early and Often
            http://www.adobe.com/devnet/acrobat/javascript.html

             

            Then most important JavaScript Development tool in Acrobat
            The Console Window (Video tutorial)
            The Console Window(article)

            • 3. Re: Zip Code Lookup
              complete_noob Level 1

              Thanks so much for your time George & Thom. That is all above my level of expertise right now but, I'll tackle it down the road as I learn more about scripting.

               

              Have a great week!