6 Replies Latest reply on Oct 12, 2010 11:18 AM by lmk1553

    Global variables on server

    lmk1553

      I have a pdf with scripts accessing persistent global variable. To this point, the file has only been required on stand-alone Windows PCs. I have been tasked to install the file on a networked system. Adobe Reader is installed at the user level. My pdf file can be installed at either the user level or at the server level. The global variables, however, need to be at the server level so that all users access the same isntance of the variables. I am assuming that the glob.js file has to be located on the server.

       

      Can someone guide me? Specifically, how do I cause the glob.js file to be created at the server level (as opposed to the user level), and how do I cause the user level Readers to look for glob.js on the server?

       

      Or is there a different, preferred approach? I'm sure you've heard this before -- I'm new to this.

       

      I would just try installing, but the networked system is located several hours drive from me and I would like to be somewhat prepared before I make the trip.

       

      Thanks for any guidance.

        • 1. Re: Global variables on server
          George_Johnson MVP & Adobe Community Professional

          There is no provision for doing what you want with glob.js, but there are other approaches you can consider. If you give more background about how you're using the global variables, it may help focus our recommendations. The more details the better.

          • 2. Re: Global variables on server
            lmk1553 Level 1

            Thanks for the quick reply.

             

            The objective of the global variables is to count and restrict the number of

            times various pages within the file are printed. Each page of the file is

            associated with two global persistent variables -- a print counter and a

            print max. Once the counter reaches the max, printing is denied.

             

            Works ok for a single user -- not great, but its functional.

             

            Need a network solution so that all users can draw upon the allowable prints

            until the max is reached.

             

            I certainly appreciate your help. Thanks..

            • 3. Re: Global variables on server
              gkaiseril MVP & Adobe Community Professional

              Have you looked at using the 'subscribe' method of the 'global' object?

               

              See the Acumen Journal for August 2004.

               

              But there is limit as to how many subscribed global variables can exist.

               

              You could also use ADBC and track this data in a database.

              • 4. Re: Global variables on server
                lmk1553 Level 1

                Thanks for the acumen reference -- read the Aug 2004 article on subscribe as

                well as a couple others -- some good stuff in there.

                 

                As best I understand the documentation on subscribe, it would apply only to

                pdfs and globals resident on a particular machine -- it can't "reach" across

                a network. In other words -- as I understand it -- User A would not be able

                to subscribe to or access User B's instance of global.AnyVar1.

                 

                Do you understand it that way? I'm needing to give all users on a network

                access to the same instance of globals.

                 

                Thanks

                • 5. Re: Global variables on server
                  gkaiseril MVP & Adobe Community Professional

                  If all can address the drive from within a PDF, you can have the control PDF file on a networked drive, but everyone will need to address the PDF with the same full address. You may need to use the URI address and not the mapped drive letter.

                   

                  You could also use a network located SQL database like an Access db.

                  • 6. Re: Global variables on server
                    lmk1553 Level 1

                    Ok, that gives me something to think about -- I'll talk to the customer's

                    network guy and see what's possible on his end.

                     

                    Thanks so much for your help.